Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

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

  1. #1
    Acolyte bobjglover@gmail.com's Avatar
    Join Date
    Aug 2015
    Posts
    41
    Articles
    0
    Excel Version
    1901

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



    Register for a FREE account, and/
    or Log in to avoid these ads!

    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. #2
    Super Moderator Bob Phillips's Avatar
    Join Date
    Mar 2011
    Posts
    1,682
    Articles
    0
    Excel Version
    O365
    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. #3
    Acolyte bobjglover@gmail.com's Avatar
    Join Date
    Aug 2015
    Posts
    41
    Articles
    0
    Excel Version
    1901
    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?
    Attached Files Attached Files

  4. #4
    Administrator AliGW's Avatar
    Join Date
    Nov 2015
    Location
    Ipswich, Suffolk, England
    Posts
    1,282
    Articles
    0
    Excel Version
    Office 365 Subscription
    I cannot see the formula in the workbook - where is it?
    Ali
    Enthusiastic self-taught user of MS Excel!

  5. #5
    Acolyte bobjglover@gmail.com's Avatar
    Join Date
    Aug 2015
    Posts
    41
    Articles
    0
    Excel Version
    1901
    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. #6
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,617
    Articles
    0
    Excel Version
    365
    Nope; no formulae at all, no table. Wrong file I expect.
    ps. 31 Feb?!

  7. #7
    Administrator AliGW's Avatar
    Join Date
    Nov 2015
    Location
    Ipswich, Suffolk, England
    Posts
    1,282
    Articles
    0
    Excel Version
    Office 365 Subscription
    D2 is a header in the table. Please attach the correct workbook and we can take it from there.
    Ali
    Enthusiastic self-taught user of MS Excel!

  8. #8
    Acolyte bobjglover@gmail.com's Avatar
    Join Date
    Aug 2015
    Posts
    41
    Articles
    0
    Excel Version
    1901
    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. #9
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,617
    Articles
    0
    Excel Version
    365
    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. #10
    Acolyte bobjglover@gmail.com's Avatar
    Join Date
    Aug 2015
    Posts
    41
    Articles
    0
    Excel Version
    1901
    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 LastLast

Posting Permissions

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