Search code examples
excelexcel-formulaarguments

Excel multiple IF(AND functions


I am making a spreadsheet with Excel where I want to have a formula that looks at multiples cells of data. This should be a pretty basic function, cell E will contain the words Low, Medium, High, or Critical, and cell H has a number in it, I would like the formula to look at both of these and give an YES or NO response. So far I have:

=IF(AND(E2="Critical",H2>7),"YES","NO")

Which works great for just looking at it if E-Critical, however I need to add the other words and numbers. I feel like the answer is easy, but I am missing it. When I try this:

=IF(AND(E2="Critical",H2>7),"YES","NO", IF(AND(E2="High",H2>14),"YES,"NO")

I get an error from excel that there are too many arguments. I am not an Excel master, so if anyone sees what I am doing incorrectly, I would appreciate the assistance! Thanks!


Solution

  • Nest each set of "YES" criteria (here using AND) within one main OR:

    =IF(OR(AND(E2="Critical",H2>7),AND(E2="High",H2>14)),"YES","NO")