Search code examples
excelexcel-2010ms-office

Excel Formulae Issues


A formula that takes logical inputs and outputs either true or a statement if all logical inputs are true.

Hey there I am trying to have a cell in excel display a text of either Valid or Invalid under a column marked Status

 =AND(IF(D2<TODAY(),"Invalid","Valid"),(IF(F2<TODAY(),"Invalid","Valid"),(IF(H2<TODAY(),"Invalid","Valid"))))

However the above formula I entered is giving me a 'value within is a wrong data type'

With the famous #Value!.

Is there anyway anyone can point out where I went wrong?


Solution

  • Each element inside of AND() needs to be an expression that evaluates to either TRUE or FALSE. Your formula has a single IF() statement inside of AND() that returns a text.

    Guessing at what you would like to achieve, try

    =IF(AND(D2<TODAY(),F2<TODAY(),H2<TODAY()),"Invalid","Valid")
    

    in words: If D2 is before today AND F2 is before today AND H2 is before today, then return the text "Invalid", otherwise return the text "Valid"