IF Statements

Hi, I am trying to create a nested IF AND statement.

I have a grid sheet that has an Approved column (Checkbox), Date column (Date), Name (Text/Number) column and Leave requested column (Text/Number)

On a new sheet I am trying to write an If statement that deals with these conditions.

I would like to sum the numbers for Leave requested for each person when Approved column is ticked and Date is between 01/01/21 and 31/01/21. So far I have this:

=IF({LEAVE FORM INFO 2021 Range 1} = 0, "", IF(AND({LEAVE FORM INFO 2021 Range 2} > 1 / 1 / 21, {LEAVE FORM INFO 2021 Range 2} < 31 / 1 / 21), COUNTIF({LEAVE FORM INFO 2021 Range 3}, {LEAVE FORM INFO 2021 Range 4} = [Column1]@row), ""))

Breakdown:

=IF({LEAVE FORM INFO 2021 Range 1} = 0, "", Is for if Approved not ticked return blank, if ticked then next conditions:

IF(AND({LEAVE FORM INFO 2021 Range 2} > 1 / 1 / 21, {LEAVE FORM INFO 2021 Range 2} < 31 / 1 / 21),

To find only between 01/01/21 - 31/01/21 and if so then:

COUNTIF({LEAVE FORM INFO 2021 Range 3}, {LEAVE FORM INFO 2021 Range 4} = [Column1]@row), ""))

Count up Leave requested column that matches conditions if Name column = Name in sheet Otherwise return blank.

Currently it is returning an invalid argument, Would appreciate any advise!

Answers