+ Reply to Thread
Results 1 to 5 of 5

Having trouble with IF statements.

  1. #1
    Registered User
    Join Date
    12-11-2019
    Location
    Minnesota
    MS-Off Ver
    Microsoft Office 365 MSO
    Posts
    8

    Having trouble with IF statements.

    I am having trouble getting a formula to work for converting an old excel data file to our new excel data template. Basically if the cell does not equal one of these five words I want it to be blank, if it does equal one of these five words I want it to just flow through to new excel. (Poor, Fair, Average, Good, and Excellent).

    I am also having trouble with figuring out a way to put a formula together so that if the cell i'm calling upon is greater than 100 it will be blank. If the cell is between 0 and 100 or 0% to 100% it will just flow through to the new cell location.

    Sorry if I do not have enough context but I have included an excel with how I want the tables to look
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Having trouble with IF statements.

    (EDIT: Note errata in red.)

    E3: =IF(OR(D3={"poor","fair","average","good","excellent"}), D3, "")

    For B3, your requirements are ambiguous. We cannot distinguish between 2 (which is okay because it is between 0 and 100) and 200% (which is not okay because it is not between 0% and 100%).

  3. #3
    Registered User
    Join Date
    12-11-2019
    Location
    Minnesota
    MS-Off Ver
    Microsoft Office 365 MSO
    Posts
    8

    Re: Having trouble with IF statements.

    Thanks for the help on the first one. To clear up the issue with B3. I may have explained it wrong. I basically only want percentages to transfer to the B Column. So any number that isnt labeled a percentage should not transfer over and I am having trouble figuring it out.

  4. #4
    Registered User
    Join Date
    12-11-2019
    Location
    Minnesota
    MS-Off Ver
    Microsoft Office 365 MSO
    Posts
    8

    Re: Having trouble with IF statements.

    I want the formula to grab from the A2 cell and if the number is between 0 and 100 to follow through as a percentage to B2. As the data set I am pulling from has the A2 cells labeled as percentages but are categorized under the general category.

  5. #5
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Having trouble with IF statements.

    Well, what appears to be percentages in column A are actually text; the other values in the column are bona fide numbers formatted to left.

    With that peculiarity, the following is sufficient in B3:

    =IFERROR(IF(AND(RIGHT(A3,1)="%", 0<=--A3, --A3<=1), A3, ""), "")

    The IFERROR covers the case (not in your file) where the rightmost character is "%", but Excel does not recognize the string as numeric.

    The double negate ("--") effective converts numeric text to a number. (Of course, it also works with numeric values.)

    In that case, B3 is text, just like A3. If you want a numeric value, replace the last A3 with --A3, and format B3 as Percentage.

    However, that would not work with bona fide percentages, where are just like any other number except for the Percentage format.

    If you want to cover that case as well, use the following in B3:

    =IFERROR(IF(OR(LEFT(CELL("format",A3),1)="p", AND(RIGHT(A3,1)="%", 0<=--A3, --A3<=1)), A3, ""), "")

    formatted as Percentage. B3 is text or numeric, depending on A3. Again, you can replace the last A3 with --A3.

+ 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] Trouble with IFS statements
    By Paddymaw in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-06-2019, 04:41 AM
  2. [SOLVED] Trouble with multiple IF/AND statements
    By codemancode in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-26-2018, 04:29 PM
  3. Having trouble with if statements with 3 criterias
    By vba_newbie83 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2014, 07:45 AM
  4. [SOLVED] Trouble with nested if/and statements
    By NamiSama in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-21-2014, 11:28 AM
  5. [SOLVED] Having trouble doing what I want with IF statements.
    By poisontoast in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2012, 03:38 AM
  6. IF statements giving me trouble...
    By Twisty20 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-11-2006, 05:18 PM
  7. Trouble with lots of IF THEN statements???
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2006, 10:26 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