+ Reply to Thread
Results 1 to 6 of 6

Combining multiple IF THEN statements

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    Collierville, Tennessee
    MS-Off Ver
    Excel 2010
    Posts
    27

    Combining multiple IF THEN statements

    Hi everyone -

    I am trying to condense this formula. It works, but it seems like there has got to be an easier way to write it.

    =IF(AND(C3>=90,C3<=119),(B3*-1),IF(AND(C3>=120,C3<=149),(B3*-2),IF(AND(C3>=150,C3<=179),(B3*-3),IF(AND(C3>=180,C3<=209),(B3*-4),IF(AND(C3>=210,C3<=239),(B3*-5),IF(AND(C3>=240,C3<=269),(B3*-6),IF(AND(C3>=270,C3<=299),(B3*-7),IF(AND(C3>=300,C3<=329),(B3*-8),IF(AND(C3>=330,C3<=359),(B3*-9),IF(C3>=360,(B3*-10),"0.00"))))))))))

    As an explanation:

    C3 has a value in it anywhere from 0-365.

    If the value in C3 is between 0 and 89, I want it to display 0.00.
    If the value in C3 is between 90 and 129, I want it to multiply B3 times -1.
    For every 30 day period after that, I want it to multiply B3 times -2, then-3, then -4, etc., all the way up to -9.
    If C3 is 360 or more, I want it to multiply B3*-10.

    I hope this makes sense. If not, I'll try to clarify it.

    Thanks a bunch.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Combining multiple IF THEN statements

    hi ktbb0312. do up a table somewhere say in H2:I2.
    0 0
    90 -1
    120 -2
    150 -3
    180 -4
    210 -5
    240 -6
    270 -7
    300 -8
    330 -9
    360 -10

    then simply:
    =LOOKUP(C3,$H$2:$H$12,$I$2:$I$12)*B3

    to avoid the table:
    =LOOKUP(C3,{0;90;120;150;180;210;240;270;300;330;360},{0;-1;-2;-3;-4;-5;-6;-7;-8;-9;-10})*B3

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    04-18-2013
    Location
    Collierville, Tennessee
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Combining multiple IF THEN statements

    Awesome! Works perfectly! Thanks so much.

  4. #4
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Combining multiple IF THEN statements

    Try this elegant version:

    =-MIN(MAX(INT(C3/30)-2,),10)*B3

  5. #5
    Registered User
    Join Date
    04-18-2013
    Location
    Collierville, Tennessee
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Combining multiple IF THEN statements

    I cannot even begin to understand why that works, but it does! Thanks.

  6. #6
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Combining multiple IF THEN statements

    You're Welcome!

+ 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