+ Reply to Thread
Results 1 to 3 of 3

IF Formula Returning Incorrect Value

  1. #1
    Forum Contributor
    Join Date
    02-14-2011
    Location
    West Valley City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    108

    IF Formula Returning Incorrect Value

    Good afternoon everyone,

    I've got a function that enters a "Territory" of the US depending on what state/province abbreviation is entered (For example, if UT is entered in B1, A1 enters U.S. West).

    For some reason I've got an issue where this simple function isn't working properly and is saying that B1 doesn't = "UT" even if it does. If I type "UT" in A2 and use the function =If(A2="UT",1,0), it works just fine.

    To add to the strangeness, My formula works for the vast majority of my cells, but doesn't for a select few (for example, if B1, B2, B3 and B4 all = "UT", A1, A2, and A3 will return the correct value, but A4 will return the incorrect value, even though they have the same formula).

    So far I've tried inserting additional columns and cut-pasting the state/province cells into the new column, but it still doesn't work. I've also cut-pasted the entire worksheet onto a new worksheet and have had the same issue.
    Last edited by Sky188; 09-25-2012 at 01:30 PM.

  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,933

    Re: IF Formula Returning Incorrect Value

    check your data for extra spaces before and after the text. you can do this by using find/replace (ctrl H) find "space" replace "nothing", so you for "find" just press the space bar once, and then in "replace", leave it blank

    let me know how you make out?
    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

  3. #3
    Registered User
    Join Date
    09-06-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: IF Formula Returning Incorrect Value

    It might take you a while to do the 52 states but here is what i got
    =IF(B1="Ut","west",IF(B1="fl","east",""))

+ 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