Search code examples
excelif-statementexcel-formulaformulasvba

(Excel) Nested IF or AND Statement


I have an Excel spreadsheet that averages a set of various data. I need a way to display nothing if cell N2 contains the value 9999.09, to make sure that value is not included in the averaging.

Excel code that needs to be modified:

=IF(T2+0<5,N6,N4)

I tried

=IF(AND(T2+0<5,N2=9999.09,N6,N4))

but that doesn't work because it really is a two condition statement. Also cell T2 displays the current hour.


Solution

  • =IF(N2=9999.09,"", Do what you wish)
    

    you can pass through "" as a null text string.