+ Reply to Thread
Results 1 to 4 of 4

nested if statement help

  1. #1
    Registered User
    Join Date
    03-14-2012
    Location
    Boise, ID
    MS-Off Ver
    Excel 2010
    Posts
    4

    Exclamation nested if statement help

    I am developing a spreadsheet to track sales. The sheet has built in drop-downs. I have a drop down with four options (ABS, A, V, or B) and each has an associated value.
    I need an output cell that calculates if ABS then 350, if A then 125, if V then 125, and if B then 0 and then this result needs to be multipled by F27 cell. I started with this function below, but it did not inlcude the B category.
    =IF(D27="ABS",350,125)*F27

    I have also tried: =if(D27="ABS", if(D27="A", if(D27="V", if(D27="B", 350, 125, 125, 0))))
    Do I need to use an OR or AND?
    Please help out here as I have searched and have tried all that I can.
    Thanks a bunch!

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: nested if statement help

    You can do this with IF statements ...

    =IF(D27="ABS",350,IF(OR(D27="A",D27="V"),125,IF(D27="B",0,"???")))

    Personally I'd go with

    =CHOOSE(MATCH(D27,{"ABS","A","V","B"},0),350,125,125,0)

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: nested if statement help

    =if(D27="ABS", 350, if(D27="A", 125, if(D27="V", 125,if(D27="B", 0,""))))
    Does that work for you?

    Alternately
    =IF(OR(D27={"A","V"}),125, IF(D27= "ABS", 350, IF(D27="B",0))))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    03-14-2012
    Location
    Boise, ID
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: nested if statement help

    Thanks so much! I chose the choose/match function and it worked like a charm.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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