Hello everyone!
I would like use the SUMPRODUCT, LEFT, and the YEAR functions simultaneously. Column D contains data in the format '2017/01' (yyyy/mm), column E contains the amounts in $ that I would like to add together. Cell C2 contains the date in format 'dd/mm/yyyy'. I would like to have a function that adds the values in E if the year(C2) = left(D:D,4) and if month(C2) = right(D:D, 2)
I wrote this function but unfortunately Excel returns 0: =SUMPRODUCT(--(LEFT(D:D,4)=YEAR(C2)), --(RIGHT(D:D,2)=MONTH(C2)),E:E). If I remove the YEAR/MONTH functions, the formula, which becomes =SUMPRODUCT(--(LEFT(D:D,4)=C2), --(RIGHT(D:D,2)=C2),E:E) works correctly. So, apparently the MONTH/YEAR functions are causing the error.
Do you have any suggestion on how I could make the formula work?
Thanks a lot in advance![]()
Bookmarks