+ Reply to Thread
Results 1 to 6 of 6

Formula help - multiple conditions for IF function

Hybrid View

  1. #1
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,690

    Re: Formula help - multiple conditions for IF function

    Here is the formula you want to use in G2 and copy down, except the values in E are not exactly what you said. Here is the formula based on your description:

    Formula: copy to clipboard
    =D2+IF(E2="A",250,IF(OR(E2="B",E2="C"),125,-D2-999))


    This allows for a fourth case where there is an error in E, and it is neither "A" nor "B" nor "C". In such a case the result will be -999 to get your attention.

    However, the data you have shows " A" with a space, not "A". It's better to fix that at the source, but the list you are using is in a different file so I can't change it. Here is a formula that assumes you don't fix it.

    Formula: copy to clipboard
    =D2+IF(TRIM(E2)="A",250,IF(OR(TRIM(E2)="B",TRIM(E2)="C"),125,-D2-999))
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  2. #2
    Registered User
    Join Date
    01-10-2016
    Location
    Brisbane, Austalia
    MS-Off Ver
    2013
    Posts
    2

    Re: Formula help - multiple conditions for IF function

    Quote Originally Posted by 6StringJazzer View Post
    Here is the formula you want to use in G2 and copy down, except the values in E are not exactly what you said. Here is the formula based on your description:

    Formula: copy to clipboard
    =D2+IF(E2="A",250,IF(OR(E2="B",E2="C"),125,-D2-999))


    This allows for a fourth case where there is an error in E, and it is neither "A" nor "B" nor "C". In such a case the result will be -999 to get your attention.

    However, the data you have shows " A" with a space, not "A". It's better to fix that at the source, but the list you are using is in a different file so I can't change it. Here is a formula that assumes you don't fix it.

    Formula: copy to clipboard
    =D2+IF(TRIM(E2)="A",250,IF(OR(TRIM(E2)="B",TRIM(E2)="C"),125,-D2-999))


    Thank you Jeff! This worked! I also removed the space after the "A". Ooooops - rookie error! Thank you everyone for all of your help/suggestions

+ 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. multiple conditions which function to use
    By bbis21 in forum Excel General
    Replies: 7
    Last Post: 11-20-2014, 09:42 PM
  2. MID Function with multiple conditions.
    By kaminanirav in forum Excel General
    Replies: 8
    Last Post: 08-28-2014, 11:56 AM
  3. [SOLVED] IF Function with multiple conditions
    By Rob.Marchel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-22-2014, 01:27 AM
  4. [SOLVED] IF function help, multiple conditions
    By wantucce in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-20-2014, 12:22 PM
  5. [SOLVED] IF function with multiple conditions
    By nicko54 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-10-2013, 01:51 AM
  6. Multiple conditions for if function
    By jiyan200 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-12-2012, 11:12 AM
  7. Looking for a function for multiple conditions
    By MrSales in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-16-2007, 03:27 PM

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