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?
1 Answer
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.
"<="&B2
?