+ Reply to Thread
Results 1 to 12 of 12

2 If statements, one cell, with list

  1. #1
    Registered User
    Join Date
    07-22-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    6

    2 If statements, one cell, with list

    So i have a list of 2 things(Yes and N/A), and I want to use those both in an IF statement for 1 cell.

    So
    =IF(D19="Yes",(E19*B19) will give me the result in the cell if the Yes condition is met. But I also need
    =IF(D19="N/A",(C19*B19) to give me the original total, or in my case the "non discounted" number.

    I tried to combine these two statements several different ways.

    =IF(D19="Yes",(E19*B19)D19="N/A",(C19*B19)) wants me to correct it to multiply the 2 formulas.


    I just cant seem to figure out how to do it. I have also tried something along the lines of
    =IF(D19="Yes",(E19*B19),"N/A",(C19*B19)) but that doesnt work right either.

    Thank you in advance!

  2. #2
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: 2 If statements, one cell, with list

    I think this is what you mean...

    =IF(D19="Yes",E19*B19,IF(D19="N/A",C19*B19,""))
    If I've been of help, please hit the star

  3. #3
    Registered User
    Join Date
    07-22-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: 2 If statements, one cell, with list

    No, see I had that formula as well. When I do that, it somehow multiplies the number.

    For instance.

    D19 = List of Yes & N/A
    E19 = $141
    B19 = Quantity(in this case 1)
    C19 = Cost(in this case $150 but discounted using another formula)

    So if Yes is selected I need the total of $141 times my quantity
    BUT
    if N/A is selected, I need the cost times my quantity.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: 2 If statements, one cell, with list

    Or maybe (if there are only 2 possible values for D19):

    =B19*IF(D19="Yes",E19,C19)

  5. #5
    Registered User
    Join Date
    07-22-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: 2 If statements, one cell, with list

    Quote Originally Posted by Cutter View Post
    Or maybe (if there are only 2 possible values for D19):

    =B19*IF(D19="Yes",E19,C19)
    I think you nailed it on the head. Thanks a lot!

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: 2 If statements, one cell, with list

    You're welcome. Thanks for the 'star tap'.

    Please remember to mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  7. #7
    Registered User
    Join Date
    07-22-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: 2 If statements, one cell, with list

    Actually no you didnt lol..

    This formula is also somehow multiplying when Yes is selected

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: 2 If statements, one cell, with list

    The formula (and the one given by Spencer101) does exactly what you requested.

    If D19 = Yes then B19 is multiplied by E19
    If D19 = N/A then B19 is multiplied by C19

  9. #9
    Registered User
    Join Date
    07-22-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: 2 If statements, one cell, with list

    Quote Originally Posted by Cutter View Post
    The formula (and the one given by Spencer101) does exactly what you requested.

    If D19 = Yes then B19 is multiplied by E19
    If D19 = N/A then B19 is multiplied by C19
    You know what, you are both right. The error is in my explanation. Let me try again, and I apologize for being an idiot...

    E19 is a discounted total from C19. What I need to do is:
    Yes = Discounted total, times quantity
    N/A = Non-Discounted total, times quantity.

    The way I was explaining it was Yes being the total of the quaantity times the total discount, then times the quanitity again, so it was mutiplying the number already multiplied. Does that make sense?

    In other words I need
    F19 to equal either:

    Non-Discounted Total(C19) times quantity(B19) - Which would be N/A
    or
    Discounted Total(E19) times quantity(B19) - Which would be Yes

    But the discounted total is already formulated with quantity in it...So thats why its multiplying the quantity twice..

  10. #10
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: 2 If statements, one cell, with list

    So, is this what you want?

    =IF(C19="N/A",B19*C19,E19)

  11. #11
    Registered User
    Join Date
    07-22-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: 2 If statements, one cell, with list

    Quote Originally Posted by Cutter View Post
    So, is this what you want?

    =IF(C19="N/A",B19*C19,E19)
    Bingo..That works...

    Thank you very much again, and sorry for the confusion. Harder to explain in writing then I thought lol..I was overthinking the formula really..

  12. #12
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: 2 If statements, one cell, with list

    You're welcome. Glad you got it working.

    Don't forget to mark as Solved.

+ 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