+ Reply to Thread
Results 1 to 2 of 2

Nested IF function works well in one sheet but not in another

  1. #1
    Registered User
    Join Date
    06-22-2013
    Location
    Australia
    MS-Off Ver
    Excel 365
    Posts
    3

    Nested IF function works well in one sheet but not in another

    Hi all, I am new to this forum so forgive me if I get the terminology wrong.


    I have created a formula for the IF function with 37 nested arguments, to look up the alphabetical price code (one for each letter A-Z of the alphabet A B C ...) in column G and return the price from the appropriate price reference in column O.
    In one worksheet it works fine, but I have copied and pasted the formula to another sheet using the same cell positions as the first sheet and all I get is 'FALSE' unless the corresponding cell from column G is empty then a result is not returned (as in the first argument of the formula)

    What am I missing ?

    =IF(G5="","",IF(G5="A",$O$5,IF(G5="B",$O$6,IF(G5="C",$O$7,IF(G5="D",$O$8,IF(G5="E",$O$9,.... and so on

    Thank you in advance

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Nested IF function works well in one sheet but not in another

    Hi and welcome to the forum

    While a 37-deep nested IF() statement may sound impressive and "look" good, you have just discovered why going more than about 4-5 deep with nested F()'s is impractical - they become a complete nightmare to trouble-shoot. Besides there are far simpler methods of doing what (I think) you want to do.

    If you (already have?) create a table with all the letters and the relative values, you can use a vlookup() formula instead of that monster.

    Play around with vlookup() and if you still have a problem, post a sample workbook (no sensitiove data), showing what you are working with, what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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