Search code examples
excelexcel-formulanested-if

Nested If Statements to lead to a Sum in a Matrix


I'm trying to write if 3 conditions are satisfied in a row, add a number in that row to a list of all the other numbers whose row's also satisfy those 3 cases.

Right now I have:

=SUM(IF(RawData!$A$2:$A$2000, "< "&A16, IF(RawData!$B$2:$B$2000, "*Name*", 
IF(RawData!$C$2:$C$2000, "*String*", RawData!$F$2:$F$2000))))

If A certain date is less than another date in a row (A2:A2000) is less than a row in a cell (A16), and a row(B2:B2000) contains the string "Name", and a row(C2:C2000) contains the string "String", then sum together the number in that row in column F(F2:F2000).

Any help would be appreciated!


Solution

  • IF does not use string literals and does not use wild cards,

    You can use a simple SUMIFS for this, which does both:

    =SUMIFS(RawData!$F$2:$F$2000,RawData!$A$2:$A$2000,"<" & A16, RawData!$B$2:$B$2000, "*Name*",RawData!$C$2:$C$2000, "*String*")