+ Reply to Thread
Results 1 to 8 of 8

Combine two IFs statement

  1. #1
    Registered User
    Join Date
    07-02-2005
    Posts
    53

    Combine two IFs statement

    I am trying to combine 2 IFs statement together to get 1 IF.

    The reason I need 2 IFs is cos excel only allows a max number of nested IFs in one cell.

    Does anyone know the solution? Or is there a better way of doing it?

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Combine two IFs statement

    Hi,
    XL versions prior to 2007 allow 7 embedded IF's.2007 much more
    Please add a small sample of your data and what you are trying to achieve
    (If you use the forum's search function on "embedded ifs" you'll find lots of answers)

  3. #3
    Registered User
    Join Date
    07-02-2005
    Posts
    53

    Re: Combine two IFs statement

    Quote Originally Posted by arthurbr View Post
    Hi,
    XL versions prior to 2007 allow 7 embedded IF's.2007 much more
    Please add a small sample of your data and what you are trying to achieve
    (If you use the forum's search function on "embedded ifs" you'll find lots of answers)
    Hi Arthur, I am on excel 2003.

    For example
    cell A1 if(x>1,1,if(x>2,2,if(x>3,3,if(x>4,4,if(x>5,5,if(x>6,6,7))))))
    cell A2 if(x>7,1,if(x>8,2,if(x>9,3,if(x>10,4,if(x>11,5,if(x>12,6,7))))))
    cell A3 to combine results of A1 and A2

    Or is there a better way of doing it?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,079

    Re: Combine two IFs statement

    Your formula won't work because everything will be 1.

    If you enter i.e. 5 he will look first IF statement (is 5>1, TRUE-> result is 1).

    Maybe you want:

    =ROUNDDOWN(B1;0)

    or this =MIN(7;ROUNDDOWN(B1;0))

    (replace ; with , if needed)
    Never use Merged Cells in Excel

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,079

    Re: Combine two IFs statement

    For second example you might want to consider this formula:

    =LOOKUP(B2;{7;8;9;10;11;12};{1;2;3;4;5;6})

  6. #6
    Registered User
    Join Date
    07-02-2005
    Posts
    53

    Re: Combine two IFs statement

    Quote Originally Posted by zbor View Post
    Your formula won't work because everything will be 1.

    If you enter i.e. 5 he will look first IF statement (is 5>1, TRUE-> result is 1).

    Maybe you want:

    =ROUNDDOWN(B1;0)

    or this =MIN(7;ROUNDDOWN(B1;0))

    (replace ; with , if needed)
    Sorry the values are arbritrary. I was trying to illustrate joining the 2 IFs statement.

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,079

    Re: Combine two IFs statement

    Combination of all, as I get it right, is slightly different:

    =IF(B1>13;7;ROUNDDOWN(MOD(B3-1;6)+1;0))

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,079

    Re: Combine two IFs statement

    Quote Originally Posted by ernestgoh View Post
    Sorry the values are arbritrary. I was trying to illustrate joining the 2 IFs statement.
    I try to ilustrate that instead of using dosen of IF's you might consider other solutions

+ 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