Summing values in a column according to results of calculation

32 views Asked by At

I want to sum values in a column according to results of calculation.

For example, dates are placed in column A. First, I want to subtract values in the column A from a static date. Then, according to results (like less than 31, between 31 and 91, greater than 91), I want to sum up values in another column.

1

There are 1 answers

0
ZygD On

Since you used SUMIFS in your question tags I assume that you talk about Excel. This is a screenshot of my dummy data and results:

sumifs results

You see dates in the column A, values to sum up in the column B. The static date is in B1.

Formula in C4 (you should copy it downwards):

=$B$1-A4

Formula in E2:

=SUMIFS($B$4:$B$9,$C$4:$C$9,"<31")

Formula in F2:

=SUMIFS($B$4:$B$9,$C$4:$C$9,">=31",$C$4:$C$9,"<=91")

Formula in G2:

=SUMIFS($B$4:$B$9,$C$4:$C$9,">91")