+ Reply to Thread
Results 1 to 5 of 5

If statement reading incorrectly

  1. #1
    Registered User
    Join Date
    02-28-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    2

    If statement reading incorrectly

    I have a spreadsheet where cell b34 references cell g29 which contains an if function. My issue is that g29 is being read as containing all of the values in the if function, when I only want it read the value of the if statement iteself. Cell g29 contains the following information

    =IF(G26=11,"530",
    IF(G26=12,"590",
    IF(G26=13,640,
    IF(G26=14,690,
    IF(G26=15,740,
    IF(G26=16,790,
    IF(G26=17,830,
    IF(G26=18,870,
    IF(G26=19,910,
    IF(G26=20,950,
    IF(G26=21,990,
    IF(G26=22,1030,
    IF(G26=23,1070,
    IF(G26=24,1100,
    IF(G26=25,1150,
    IF(G26=26,1190,
    IF(G26=27,1220,
    IF(G26=28,1260,
    IF(G26=29,1300,
    IF(G26=30,1340,
    IF(G26=31,1380,
    IF(G26=32,1420,
    IF(G26=33,1460,
    IF(G26=34,1510,
    IF(G26=35,1560,
    IF(G26=36,1600,"0")
    )))))))))))))))))))))))))

    I want cell b34 to tell me if the value of cell g29 is greater than 1100. Currently it always reads yes because it's reviewing all of the information in cell g29 instead of just the true if statement whatever that happens to be. Any suggestions?

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: If statement reading incorrectly

    Hi LifeMeansChange

    See the attached, might be of some help!
    Attached Files Attached Files
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  3. #3
    Registered User
    Join Date
    02-28-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    2

    Re: If statement reading incorrectly

    Thanks for the reply Kevin! Unfortunately, I'm not sure that this will help. I need to be able to input a number between 11 and 36 into cell g34 which determines what will be displayed in cell g29. I'm not familiar with tables and vlookup so could you explain how this may be able to help me out?

  4. #4
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: If statement reading incorrectly

    Hi LifeMeansChange

    If you input a number between 11 & 36 into the green cell (G34) and then look at the value in the blue cell (G29). See the attached, the VLOOKUP is a lot shorter and easier to maintain.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-24-2012
    Location
    York, England
    MS-Off Ver
    Excel 2003/07/10
    Posts
    165

    Re: If statement reading incorrectly

    Hi LifeMeansChange
    It might be that Kevins suggestion is a satisfactory alternative, but there is no reason why your formula shouldn't work.
    I think that there must be an error somewhere. Ive created a smaller one that seems to work OK.
    Does G29 display a result (E.g. 530) or is it displaying the formula in the cell ? If the latter it might be that the cell is formatted to display text only.
    I noticed that in your If statements the results are mostly numbers, but some string values. If you have other cells dependent upon the value returned in
    G29 this might cause unexpected results.
    As Ive done, create a smaller version with just a few nested IFs and get that working before adding to it.

    HTH
    Attached Files Attached Files
    Last edited by Hercules1946; 03-01-2013 at 10:11 AM. Reason: Invalid Upload

+ 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