+ Reply to Thread
Results 1 to 5 of 5

Formula not giving expected results

  1. #1
    Forum Contributor
    Join Date
    06-11-2018
    Location
    Lebanon, NH
    MS-Off Ver
    2000 and 2010
    Posts
    106

    Formula not giving expected results

    Good morning!
    I ran into an interesting issue yesterday. A formula that has worked correctly since it was written by a predecessor 2 years ago gave a very unexpected result. Formula is is follows;
    =(IF(A256="Andersen 200",Windows!C9,IF(A256="Andersen 400",Windows!C15,IF(A256="JW Builders Vinyl w/J Chnl",Windows!C23,IF(A256="JW Brickmould Vinyl w/J Chnl",Windows!C28,IF(A256="JW Flat Casing w/J Chnl",Windows!C33,IF(A256="Paradigm",Windows!C38,IF(A256="Paradigm Triple",Windows!C43,IF(A256="Paradigm Flat Casing",Windows!C48, 0))))))))&IF(A256="MasterView Vinyl", Windows!C53, IF(A256="MasterView Vinyl Flat Casing",Windows!C60,IF(A256="Mathew Bros Vinyl",Windows!C67,IF(A256="Mathew Bros Vinyl Flat Casing",Windows!C73, 0)))))*1

    Apparently the fellow who wrote the formula ran into the nested IF limit and had to add to the formula using the &. Yesterday I had to select the Anderson 400 and instead of seeing a cost of $183 as expected I saw $1830. I checked a couple of things, evaluated the formula and it was $183 all the way until the very last step. Then it changed to $1830. Hmmm... I changed the "&" to "+" and now all is well. Thought it might save someone else some time in the future.
    Thanks,
    Bill

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula not giving expected results

    For your information, that nested IF limit is much higher now, unless you're still using a really old version of excel (2003 or prior).

    Also there are many alternative methods that are much neater.

    =CHOOSE(MATCH(A256,List,0),Windows!C9,Windows!C15,etc...) would be my method of choice. Where List refers to a list of all the possible names that could be entered into A256.

  3. #3
    Forum Contributor
    Join Date
    06-11-2018
    Location
    Lebanon, NH
    MS-Off Ver
    2000 and 2010
    Posts
    106

    Re: Formula not giving expected results

    Jasonb75,
    Thanks very much for your response. I am aware of the increased limits but am restricted to using Excel 2000 for the foreseeable future. There are 160 or so variant of this formula that I have on the list to rewrite when I get a chance, but I'm under the gun on this one so it it functions and gives expected results every time it stays for now. Maybe in phase 3 I can finish the cleanup.
    Thanks much!
    Bill

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula not giving expected results

    From what I can see of your formula, it may have been giving incorrect results for sometime, but has only just been noticed
    The way the formula is written, any result from the nested IF before the & would have incorrectly had a trailing zero joined to it.

    For decimal values, this would not be a problem 1.2 and 1.20 are both the same, but if you have integers (in your case, amounts exactly to the dollar) then the result would be wrong.

  5. #5
    Forum Contributor
    Join Date
    06-11-2018
    Location
    Lebanon, NH
    MS-Off Ver
    2000 and 2010
    Posts
    106

    Re: Formula not giving expected results

    Jason.b75,
    Agreed. This was the part of the project that was supposed to be "ALL SET" when they handed it over to me. I have now removed the "&" from all formulas in this project. It just so happened that I used options that are rarely used and that is when the issue showed up.
    Thanks
    Bill

+ 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] split formula format litrage measurement need adjustment not giving expected results
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-17-2018, 12:49 PM
  2. [SOLVED] RIGHT Formula not giving expected results
    By billfinnjr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-28-2018, 09:13 AM
  3. [SOLVED] Formula not giving expected results
    By billfinnjr in forum Excel General
    Replies: 7
    Last Post: 08-15-2018, 09:58 AM
  4. [SOLVED] split formula of data not giving expected results need assistance
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 05-15-2018, 12:57 PM
  5. [SOLVED] assistance required copy macro not giving expected results to new sheet
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-14-2017, 01:37 PM
  6. IF Formula not giving expected results.
    By fungus in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2010, 02:10 PM
  7. Sumproduct formula not giving expected results
    By Shocked in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-30-2008, 03:12 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