+ Reply to Thread
Results 1 to 6 of 6

Excel Formula Error

  1. #1
    Registered User
    Join Date
    08-20-2009
    Location
    London
    MS-Off Ver
    Office 2019
    Posts
    28

    Excel Formula Error

    Hi all,

    I have a non-functioning formula in Excel again - it's a big one!

    =IF(ISERROR(-IF(COUNTIF(C4,"W???U"),MID(C4,2,3),IF((C520="WU100"),VLOOKUP(C520,Redemptions!A:D,4,0),IF((RIGHT(C520,3)="DMU"),VLOOKUP(C520,Redemptions!A:D,4,0),-IF(COUNTIF(C4,"O??A"),VLOOKUP(C4,Redemptions!A:D,4,0),-IF(COUNTIF(C4,"O???A"),VLOOKUP(C4,Redemptions!A:D,4,0),IF(OR(LEFT(C4,2)={"DN","WA","MC","LW","LB","DU","LC","IL"}),MID(C4,3,3),0))))))),0,-IF(COUNTIF(C4,"W???U"),MID(C4,2,3),IF(C520="WU100"),VLOOKUP(C520,Redemptions!A:D,4,0),IF(RIGHT(C520,3)="DMU"),VLOOKUP(C520,Redemptions!A:D,4,0),-IF(COUNTIF(C4,"O??A"),VLOOKUP(C4,Redemptions!A:D,4,0),-IF(COUNTIF(C4,"O???A"),VLOOKUP(C4,Redemptions!A:D,4,0),IF(OR(LEFT(C4,2)={"DN","WA","MC","LW","LB","DU","LC","IL"}),MID(C4,3,3),0)))))

    All I have done is added a couple of new constraints (highlighted in bold) to a previous formula I had that DID work:

    =IF(ISERROR(-IF(COUNTIF(C4,"W???U"),MID(C4,2,3),-IF(COUNTIF(C4,"O??A"),VLOOKUP(C4,Redemptions!A:D,4,0),-IF(COUNTIF(C4,"O???A"),VLOOKUP(C4,Redemptions!A:D,4,0),IF(OR(LEFT(C4,2)={"DN","WA","MC","LW","LB","DU","LC","IL"}),MID(C4,3,3),0))))),0,-IF(COUNTIF(C4,"W???U"),MID(C4,2,3),-IF(COUNTIF(C4,"O??A"),VLOOKUP(C4,Redemptions!A:D,4,0),-IF(COUNTIF(C4,"O???A"),VLOOKUP(C4,Redemptions!A:D,4,0),IF(OR(LEFT(C4,2)={"DN","WA","MC","LW","LB","DU","LC","IL"}),MID(C4,3,3),0)))))

    Could somebody please tell me a correct formula and also, to help for the future, why the added new constraints bring back an error. I think it has something to do with parentheses but am not sure which ones and where or why.

    Thanks in advance!

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Excel Formula Error

    Good morning lozg43
    Quote Originally Posted by lozg43 View Post
    Could somebody please tell me a correct formula and also [and] why the added new constraints bring back an error. I think it has something to do with parentheses but am not sure which ones and where or why.
    I'm not really a formula guru, but it looks to my untrained eye that you have too many nested ifs. Excel allows a maximum of seven, so this is probably why your formula fails when you add more. I seem to remember that Excel 2007 allows more - 57 more, 64 in all ...

    http://www.cpearson.com/excel/nested.htm

    HTH

    DominicB
    Last edited by dominicb; 08-24-2009 at 06:10 AM.
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Excel Formula Error

    Can you upload example workbook.. There must be simplier solution

  4. #4
    Registered User
    Join Date
    08-20-2009
    Location
    London
    MS-Off Ver
    Office 2019
    Posts
    28

    Re: Excel Formula Error

    It's ok thanks.

    I just decided to not try and be too clever for myself and do a set of simple manual vlookups.

    Thanks for the advice though

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Excel Formula Error

    Just out of idle curiosity does the below work:

    Please Login or Register  to view this content.
    The above is based on your original formula and is based on assumption that result of formula is numeric when not an error.

  6. #6
    Registered User
    Join Date
    08-20-2009
    Location
    London
    MS-Off Ver
    Office 2019
    Posts
    28

    Re: Excel Formula Error

    Unfortunately not quite in the way I had wanted it to.

    Thanks all the same

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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