ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sum based on the dates in a different row. (https://www.excelbanter.com/excel-worksheet-functions/129907-sum-based-dates-different-row.html)

Gary

Sum based on the dates in a different row.
 
Another similar kind of problem....I have dates running from 1/1/2007 to
29/6/2007 from C2 to EB2 and I have some values in the row
14 (C14 to EB14). Now I want the sum of all the values. I want the formula
to look for month 1 in row 2 and then return the sum of all the values in
row 14. same for Feb, March, April, May and June.

I entered the following formula.

=SUM(IF(MONTH($C$2:$EB$2)=1,$C15:$EB15))

but it is adding all the values instead of adding the values of January
only. I also dragged it to next column and changed the month to 2 but in
Feb, it shows me 0 and in Jan, it also adds the Feb values.

Please help.



Teethless mama

Sum based on the dates in a different row.
 
=SUM(IF(MONTH($C$2:$EB$2)=COLUMNS($A:A),$C$15:$EB1 5))

ctrl + shift + enter, not just enter
copy across the columns


"Gary" wrote:

Another similar kind of problem....I have dates running from 1/1/2007 to
29/6/2007 from C2 to EB2 and I have some values in the row
14 (C14 to EB14). Now I want the sum of all the values. I want the formula
to look for month 1 in row 2 and then return the sum of all the values in
row 14. same for Feb, March, April, May and June.

I entered the following formula.

=SUM(IF(MONTH($C$2:$EB$2)=1,$C15:$EB15))

but it is adding all the values instead of adding the values of January
only. I also dragged it to next column and changed the month to 2 but in
Feb, it shows me 0 and in Jan, it also adds the Feb values.

Please help.





All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com