+ Reply to Thread
Results 1 to 5 of 5

Multiple IF arguments in the one cell

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    41

    Multiple IF arguments in the one cell

    Hi guys, I was wondering if anyone could help me out with these two? I have two different dilemmas, in two different spreadsheets.

    In both spreadsheets I have tried IF statements (including AND formulas), and VLookup. But I’m continuously getting NAME errors, and I seem to have too many arguments for a normal IF statement.

    In the first example, from B2 – B6 I have empty cells which I type in either of - Y, S or N.
    In cells C2 – C6 I need to show the value of each individual cell based on whichever of Y, S or N is entered into column B.
    The values I need to apply for each letter are - 20 for Y, 8 for S, 0 for N.
    For example – If I had Y in B2, then 20 would appear in C2. If a S was in B3, then 8 would appear in C3 etc.



    In the other spreadsheet, I have a slightly different scenario I also need to rectify.

    From B2 – B7 I have empty cells again, to be able to enter either a Y or N. But in cell B6 ONLY, there is also an option to enter N/A along with a Y or N.
    What I need to do in column C is similar to the first problem above. I need C2 – C7 to populate based on what the entered letters in column B’s value is.

    This is where it gets tricky – If B6 doesn’t have N/A entered into it (so has Y or N), any cell in column B with a Y will have a value of 16.7. But if B6 has N/A entered into it, then any cell in column B with a Y is worth 20.

    Once again, any cell that has a letter N in column B, it should be reflected with a zero in the corresponding cell in column C.
    So basically, if there is an N/A in B6 then Y is worth 20 for all cells. If B6 doesn’t have an N/A then Y is worth 16.7 for all cells. N is worth 0 either way, whether there is an N/A in play or not.

    I don't want to use a macro for this.

    Thanks!
    Rooboyz

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Multiple IF arguments in the one cell

    first bit
    =if(LOOKUP(B2,{"n","s","y"},{0,8,20})
    2nd bit
    what value do you want in c6 when b6 says n/a?
    if its 0 then
    =IF(AND(B2="y",$B$6<>"n/a"),16.7,LOOKUP(B2,{"n","y"},{0,20}))
    Last edited by martindwilson; 02-07-2013 at 08:07 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    10-09-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Multiple IF arguments in the one cell

    Quote Originally Posted by martindwilson View Post
    first bit
    =if(LOOKUP(B2,{"n","s","y"},{0,8,20})
    2nd bit
    what value do you want in c6 when b6 says n/a?
    if its 0 then
    =IF(AND(B2="y",$B$6<>"n/a"),16.7,LOOKUP(B2,{"n","y"},{0,20}))

    The 2nd bit works perfect, thank you!

    The 1st bit isn't working, it is needing the rest of the IF statement to be completed with the true and false part. Along with the closing bracket.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Multiple IF arguments in the one cell

    oops drop the if i was trying the second out at the same time
    =LOOKUP(B2,{"n","s","y"},{0,8,20})
    but maybe you need
    if(b2="","",LOOKUP(B2,{"n","s","y"},{0,8,20}))

  5. #5
    Registered User
    Join Date
    10-09-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Multiple IF arguments in the one cell

    Quote Originally Posted by martindwilson View Post
    oops drop the if i was trying the second out at the same time
    =LOOKUP(B2,{"n","s","y"},{0,8,20})
    but maybe you need
    if(b2="","",LOOKUP(B2,{"n","s","y"},{0,8,20}))

    Thanks for your help on this! i didn't reply last time. But i just added to your reputation. Thanks appreciate your help.

+ 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