+ Reply to Thread
Results 1 to 6 of 6

multiple if/then statement

  1. #1
    Forum Contributor
    Join Date
    03-14-2005
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    172

    multiple if/then statement

    I want a formula that will give different results based on what's in one cell. For example, if e39>5,000, then give me "1", if greater than 12,000, give me "2",if greater than 20,000, give me "3", if less then 5,000, give me "0". Is there a simple way to do this?

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: multiple if/then statement

    You can try this:

    =LOOKUP(E39,{-2.2251E-308,5000,12000,20000},{0,1,2,3})

    - Moo

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: multiple if/then statement

    Try this:

    =IF(E39<5000,0,IF(E39<12000,1,IF(E39<20000,2,3)))

    Hope this helps.

    Pete

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: multiple if/then statement

    Something like this, perhaps:

    =IF(E39<5000,0,IF(E39<12000,1,IF(E39<20000,2,3)))

    Although you don't specify the result if E39 is exactly equal to any of your values, and if it is is greater than 20,000 then it will also be greater than 12,000.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: multiple if/then statement

    Try this:

    =if(E39<5000,0,if(and(E39>=5000,E39<12000),1,if(and(E39>=12000,E39<20000),2,if(E39>=20000,3,""))))
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Forum Contributor
    Join Date
    03-14-2005
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    172

    Re: multiple if/then statement

    All worked good, thanks guys!

+ 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