+ Reply to Thread
Results 1 to 20 of 20

multiple "IF" formula

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    10

    multiple "IF" formula

    Hi all

    I have a multiple "IF" formula as below and excel says: "too many arguments...". What's your solution for this problem?

    =IF(C2="X",IF(I2<='Definition-S,P'!A4,1,IF(I2<='Definition-S,P'!A5,2,IF(I2<='Definition-S,P'!A6,3,IF(I2<='Definition-S,P'!A7,4,IF(I2<='Definition-S,P'!A8,5))))),IF(C2="Y",IF(I2<='Definition-S,P'!A13,1,IF(I2<='Definition-S,P'!A14,2,IF(I2<='Definition-S,P'!A15,3,IF(I2<='Definition-S,P'!A16,4,IF(I2<='Definition-S,P'!A17,5)))))),IF(C2="Z",IF(I2<='Definition-S,P'!A22,1,IF(I2<='Definition-S,P'!A23,2,IF(I2<='Definition-S,P'!A24,3,IF(I2<='Definition-S,P'!A25,4,IF(I2<='Definition-S,P'!A26,5)))))),"")

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: multiple "IF" formula

    Try:

    =IF(C2="X",IF(I2<='Definition-S,P'!A4,1,IF(I2<='Definition-S,P'!A5,2,IF(I2<='Definition-S,P'!A6,3,IF(I2<='Definition-S,P'!A7,4,IF(I2<='Definition-S,P'!A8,5))))),IF(C2="Y",IF(I2<='Definition-S,P'!A13,1,IF(I2<='Definition-S,P'!A14,2,IF(I2<='Definition-S,P'!A15,3,IF(I2<='Definition-S,P'!A16,4,IF(I2<='Definition-S,P'!A17,5))))),IF(C2="Z",IF(I2<='Definition-S,P'!A22,1,IF(I2<='Definition-S,P'!A23,2,IF(I2<='Definition-S,P'!A24,3,IF(I2<='Definition-S,P'!A25,4,IF(I2<='Definition-S,P'!A26,5))))),"")))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    09-13-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: multiple "IF" formula

    Thanks but it didn't work!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: multiple "IF" formula

    Did the formula get accepted? How did it not work?

  5. #5
    Registered User
    Join Date
    09-13-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: multiple "IF" formula

    No, the same note! "you've entered too many arguments for this function"

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: multiple "IF" formula

    Try again. It works for me in 2007 and even in 2003.

  7. #7
    Registered User
    Join Date
    09-13-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: multiple "IF" formula

    It did I guess!!!
    First I thought you had changed the last parentheses but now I copied the whole formula in it and it worked!!
    I will perform it for the whole sheet then let you know about the final result
    Thanks a lot

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

    Re: multiple "IF" formula

    How about this:

    =MATCH(I2;OFFSET('Definition-S,P'!A4:A8;9*CODE(UPPER(C2))-792)

  9. #9
    Registered User
    Join Date
    09-13-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: multiple "IF" formula

    I tested the formula but it didn't work for items "Y" and "Z"! I can't realize what the problem is!!???

  10. #10
    Registered User
    Join Date
    09-13-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: multiple "IF" formula

    Hi everyone

    How can we fix some variables in a formula and then extend it to the other cells?

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: multiple "IF" formula

    You are going to have to elaborate on that....

  12. #12
    Registered User
    Join Date
    09-13-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: multiple "IF" formula

    I solved my mistake on the former problem. But please answer the latter one

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: multiple "IF" formula

    Which is specifically?

  14. #14
    Registered User
    Join Date
    09-13-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: multiple "IF" formula

    I mean fixing the variables in different formulas (just some of them). Is it clear?

  15. #15
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: multiple "IF" formula

    It's not clear. What exactly do you mean? Give examples too.

  16. #16
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    wales
    MS-Off Ver
    Excel 2007
    Posts
    964

    Re: multiple "IF" formula

    i think he means like makeing x = 3

    which you could do with named ranges
    The Importance of INDEX - A GUIDE TO INDEX'S OTHER USES
    <--- If a post helps hit the star

  17. #17
    Registered User
    Join Date
    09-13-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: multiple "IF" formula

    For example in the discussed formula, I wanna keep !A5-!A26 fixed and copy it into the other cells so that only the rest of variables (C*, I*) change in number.

    =IF(C2="X",IF(I2<='Definition-S,P'!A4,1,IF(I2<='Definition-S,P'!A5,2,IF(I2<='Definition-S,P'!A6,3,IF(I2<='Definition-S,P'!A7,4,IF(I2<='Definition-S,P'!A8,5))))),IF(C2="Y",IF(I2<='Definition-S,P'!A13,1,IF(I2<='Definition-S,P'!A14,2,IF(I2<='Definition-S,P'!A15,3,IF(I2<='Definition-S,P'!A16,4,IF(I2<='Definition-S,P'!A17,5))))),IF(C2="Z",IF(I2<='Definition-S,P'!A22,1,IF(I2<='Definition-S,P'!A23,2,IF(I2<='Definition-S,P'!A24,3,IF(I2<='Definition-S,P'!A25,4,IF(I2<='Definition-S,P'!A26,5))))),"")))
    Hope it is clear enough
    Thanks

  18. #18
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: multiple "IF" formula

    That is called Absolute referencing...

    put $ in front of row/column indicator that you want to freeze, e.g. $A$5 will freeze cell A5, $A5 will only freeze column A, A$5 will only freeze row 5.

    Here's more on the subject: http://www.cpearson.com/excel/relative.aspx

  19. #19
    Registered User
    Join Date
    07-31-2012
    Location
    cape cod
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: multiple "IF" formula

    $A$5 and put the dollar signs in each of the lines you want fixed. The rest will fill down accordingly.

  20. #20
    Registered User
    Join Date
    09-13-2012
    Location
    tehran
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: multiple "IF" formula

    Thank you guys
    Your comments was very very helpful ))

+ 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