#INVALID OPERATION with INDEX(COLLECT

Completely Stumped. For all intents & purposes, I have the same formula in two columns and one is working and one is not. Would be grateful for a solution.

The Stage:

I am trying to retrieve 'yesterday's' Meter Reading (Gallons) into today's row to calculation consumption between yesterday and today. (The Formula does interrogate an indicator to see if the data is missing for the previous day so it can indicate that if needed)

  • All 'Meter Reading' columns are Text/Number
  • Meter Reading (Cubic Feet) formula:
    • =IF([Measurement Type]@row = "Cubic Feet", [Meter Reading]@row) *Where [Meter Reading]@row is the result of a form entry
  • Meter Reading (Gallons) formula:
    • =IF([Measurement Type]@row = "Cubic Feet", ([Meter Reading]@row / 7.48052), [Meter Reading]@row)

The working formula:

=IF([Missing Previous Day]@row = 0,

INDEX(COLLECT([Meter Reading (Cubic Feet)]:[Meter Reading (Cubic Feet)],

[Site ID]:[Site ID], [Site ID]@row,

[Form Submission Date]:[Form Submission Date], [Form Submission Date]@row - 1), 1), "Data NA")

The non-working formula (last column in picture above showing #INVALID OPERATION):

=IF([Missing Previous Day]@row = 0,

INDEX(COLLECT([Meter Reading (Gallons)]:[Meter Reading (Gallons)],

[Site ID]:[Site ID], [Site ID]@row,

[Form Submission Date]:[Form Submission Date], [Form Submission Date]@row - 1), 1), "Data NA")

NOTE: 100 points to anyone that can enlighten me

Best Answer

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!