+ Reply to Thread
Results 1 to 5 of 5

Formula not working as expected

  1. #1
    Registered User
    Join Date
    03-03-2016
    Location
    Reading
    MS-Off Ver
    2013
    Posts
    6

    Formula not working as expected

    Hi,

    I tried to amend a formula to add an additional rule but I must have it wrong as it's not returning the value I expect.

    This is the original formula which works fine:

    =IF(AC5>45,"",IF(AC5>29,"Must",IF(AC5>19,"Should",IF(AC5>9,"Could",IF(AC5>=0,"Will Not")))))

    This is the amended formula:

    =IF(AC4>45,"",IF(AC4>29,"Must",IF(AC4>19,"Should",IF(AC4>9,"Could",IF(AC4>=0,"Will Not",IF(AC4=Legal or Fiscal,"Must"))))))

    Thank you

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Formula not working as expected

    Undeterminable as you haven't explained what you're trying to achieve.
    But you either want this

    =IF(AC4 > 45,"",IF(AC4 > 29,"Must",IF(AC4 > 19,"Should",IF(AC4 > 9,"Could",IF(AC4 > =0,"Will Not",IF(AC4="Legal or Fiscal","Must","OTHER"))))))

    or this

    =IF(AC4 > 45,"",IF(AC4 > 29,"Must",IF(AC4 > 19,"Should",IF(AC4 > 9,"Could",IF(AC4 > =0,"Will Not",IF(OR(AC4="Legal",AC4="Fiscal"),"Must","OTHER"))))))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: Formula not working as expected

    Hi,
    Perhaps you've forgot to hard-code the text with ""

    try:
    =IF(AC5>45,"",IF(AC5>29,"Must",IF(AC5>19,"Should",IF(AC5>9,"Could",IF(AC5>=0,"Will Not",IF(AC5="Legal or Fiscal","Must"))))))

    or this if legal or fiscal are separate:
    =IF(AC5>45,"",IF(AC5>29,"Must",IF(AC5>19,"Should",IF(AC5>9,"Could",IF(AC5>=0,"Will Not",IF(OR(AC5={"Legal","Fiscal"}),"Must"))))))

    Moreover, I suggest to make a lookup table instead of nesting IFs.

    Blessing.
    Khalid

  4. #4
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: Formula not working as expected

    Didn't noticed Special-K already replied

  5. #5
    Registered User
    Join Date
    03-03-2016
    Location
    Reading
    MS-Off Ver
    2013
    Posts
    6

    Re: Formula not working as expected

    Thank you both for taking the time to reply. This is perfect.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] IF/ELSEIF not working as expected
    By amphinomos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2015, 10:00 AM
  2. PowerPivot Not Working As Expected
    By EnigmaMatter in forum Excel General
    Replies: 1
    Last Post: 04-30-2015, 04:07 PM
  3. ISNA not working as expected
    By micco in forum Excel General
    Replies: 2
    Last Post: 06-30-2011, 01:54 PM
  4. [SOLVED] IF statement is not working as expected?
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2009, 02:02 PM
  5. vlookup/if formula not working as expected
    By Shocked in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-11-2008, 10:06 AM
  6. For Each Statement not working as expected
    By Jacqui in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:20 PM
  7. [SOLVED] Lookup Not working as expected
    By trumpy81 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 06-30-2005, 03:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1