# Thread: IF statement not working - I'm using .xlsx file

1. ## IF statement not working - I'm using .xlsx file

Hello Guru's,

Hope you can assist, this is returning Red parens on the nested part and not working. g3 is the same as @Days left column - I am guessing this is a new function of xlsx. describing a cell when you = it?

=IF(g3<0, "Expired",if([@[Days Left]]<30, "Expiring Soon", ""))

Thanks - Bob

2. Excel versions have functions, not whether it is an xlsx, xlsm, xlsb, or xlam.

What does the data look like, and what is nit working with that formula (I didn't understand what you wrote).

3. Bob,

Thanks for the quick response, see attached for what i am trying to do and what the formula is doing. It should be fairly simple not sure why it isn't functioning?

4. I cannot see the formula in the workbook - where is it?

5. Hi,

The formula is in D2 of the attachment...looks like this - =IF(c3<0,"Expired",IF(c3<30,"Expiring soon","")). So I got this one to work but it doesn't do exactly what I need =IF((AND(G4<=0, G4<=30)), "Expired", ""). I need the formula to return 1 of 3 values "Expired", "Soon", or nothing in the cell. So I am trying to work with this one and have the same challenge as the first one - =IF(g3<=0, "Expired", IF(g3<=30, "Soon", IF(g3>30, "Ok ", "")))

6. Nope; no formulae at all, no table. Wrong file I expect.
ps. 31 Feb?!

7. D2 is a header in the table. Please attach the correct workbook and we can take it from there.

8. My apologies wrong file,. But it did force me to figure it out on the 1st round of the "If" statement. =IF(G12<=0, "Expired", IF(G12<=30, "Soon", IF(G12>30, "Ok ", ""))) I need to extend it to do more functions, can I post here?

9. This is equivalent to your existing formula:
=INDEX({"Expired","Soon","OK"},MATCH(G12,{0,1,31}))
You can extend it thus:
=INDEX({"Expired","Very Near expiry","Getting close","11 days to go","about 16 days","3 weeks","26 days","OK"},MATCH(G12,{0,1,6,11,16,21,26,31}))

10. Index...never would have thought of that, ty! So the MATCH #s in brackets are equivalent to what I can put days out? I think the challenge with this is I am unable to call out "between"? for instances I am hoping to identify contracts that are 30 days and under as" Very Near/Yellow" and 30-90 days "Getting Close/Orange" and the remainder over 90 "Ok/Green"?

Page 1 of 2 1 2 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•