1

I have a SUMIFS that gets the desired result. But the condition is formatted as a string, in this case a date comparison, "<=2023-03-21". The date is located in cell B2. How can I rewrite this condition to use the value from B2 instead of a fixed date string value?

3
  • 1
    Have you tried constructing the date criterion within SUMIFS by concatenating the comparison operator in string and the cell B2, i.e. "<="&B2?
    – Alper
    Mar 23 at 13:50
  • That's what I needed, but I didn't know the syntax. Thanks! Mar 23 at 17:28
  • 1
    @Alper I don't know if you care about reputation points on this site but if you make that an answer I'll accept it. Mar 23 at 21:40

1 Answer 1

1

You can construct the date criterion within SUMIFS by concatenating the comparison operator in string and the cell B2, i.e. "<="&B2.

This surprisingly works when the test range provided to SUMIF comprise either cells formatted as dates or cells with ISO-form dates in string format like in your case. I guess Numbers internally takes care of the data type transformations necessary in both cases so that the comparisons and filtering are made as intended.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .