Yu Yu
Yu Yu

Reputation: 11

Problem with Excel IF function having too many arguements

I'm trying to automate a task for myself to see if I can see if an item is "overdue". However, I also wanted to add in a feature where if the item has been returned, then I won't be warned that that item is overdue. This is what I came up with so far:

=IF(OR(AND(A2<=TODAY()-14)), AND(D2=returned),"Overdue","Not due")

I'm currently trialling a 2 week loan period, where if the item is returned not returned within 14 days, I want the B column to show "overdue".

In my excel sheet, I'm currently trying to have cell B2 to show "not due" because while it has been more than 14 days, the item has been "returned" as can be seen from column D.

My current excel sheet

Thank you.

Upvotes: 1

Views: 41

Answers (2)

topgunner
topgunner

Reputation: 52

=IF(AND(A2<=(TODAY()-14), D2<>"returned"),"Overdue","Not due")

Upvotes: 0

bcy
bcy

Reputation: 56

Try

=IF((OR(A2>TODAY(), D2="returned")), "Not Due", "Overdue")
  • Use the syntax for Example 2 to get a clean OR
  • Switch Not Due and Overdue because it is easier to reason about with OR than AND
  • Put quotes around "returned". Note you could use LOWER(D2) if you want to control for capitalization

Upvotes: 1

Related Questions