+ Reply to Thread
Results 1 to 9 of 9

Help getting my syntax correct

Hybrid View

MMS6300 Help getting my syntax correct 02-20-2009, 01:24 PM
NBVC Re: Help getting my syntax... 02-20-2009, 01:26 PM
MMS6300 Re: Help getting my syntax... 02-20-2009, 01:35 PM
NBVC Re: Help getting my syntax... 02-20-2009, 01:41 PM
MMS6300 Re: Help getting my syntax... 02-20-2009, 01:57 PM
NBVC Re: Help getting my syntax... 02-20-2009, 02:10 PM
MMS6300 Re: Help getting my syntax... 02-20-2009, 02:21 PM
NBVC Re: Help getting my syntax... 02-20-2009, 02:23 PM
MMS6300 Re: Help getting my syntax... 02-20-2009, 02:26 PM
  1. #1
    Registered User
    Join Date
    02-20-2009
    Location
    McKinney, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Help getting my syntax correct

    I am calculating shipping charges in Excel 2007.

    A1 is a drop down box with two options: Standard shipping and Priority Shipping.

    I need to calculate based on two conditions:

    If "Standard Shipping" is selected and the # of items (B1) is <=5, then the shipping charge (C1) = $5.00.

    I need to nest this for 4 different values for B1 AND for Standard Shipping and Priority Shipping. I could also use two check boxes instead of the drop down if that would be better.

    I just can't seem to get it right.
    Last edited by MMS6300; 02-20-2009 at 02:23 PM.

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

    Re: Help getting my syntax correct

    Could you include all possibilities and the desired outcomes for each?
    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
    02-20-2009
    Location
    McKinney, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help getting my syntax correct

    For Standard Shipping:

    If B1 <= 15, then C1 = $5.00
    If B1 >15, <=40, then C1 = $9.00
    If B1 >40, <=60, then C1 = $11.00
    If B1 >60, <=80, then c1 = $14.00


    For Priority Shipping:

    If B1 <= 4, then C1 = $5.00
    If B1 >4, <=15, then C1 = $11.00
    If B1 >15, <=30, then C1 = $17.00
    If B1 >30, <=45, then c1 = $24.00

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

    Re: Help getting my syntax correct

    Try:

    =IF(A1="","",IF(A1="Standard Shipping",LOOKUP(B1,{0,16,41,61},{5,9,11,14}),LOOKUP(B1,{0,5,16,31},{5,11,17,24})))
    note: this formula assumes that outside the upper bound of each range, then it takes the highest cost... if that is not the case, what do you want if the upperbound number in B1 exceeds the choices you have?

  5. #5
    Registered User
    Join Date
    02-20-2009
    Location
    McKinney, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help getting my syntax correct

    That worked for the standard shipping. How to I get it to change for the Priority shipping?

    And..it only show a number .. 5.. instead of $5.00. Any fix for that?

    Thank you thank you thank you!

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

    Re: Help getting my syntax correct

    Quote Originally Posted by MMS6300 View Post
    That worked for the standard shipping. How to I get it to change for the Priority shipping?

    And..it only show a number .. 5.. instead of $5.00. Any fix for that?

    Thank you thank you thank you!
    Try changing A1 to "Priority Shipping" you should see that it does work...

    My formula assumes you have only the 2 choices... if Standard Shipping is selected it will do one calculation, otherwise it will do the other... unless A1 is blank...then it will return a blank.

    The 5 to $5.00 is a matter of formatting your cell... Format it as Currency.. through Format|Cells >> Number tab.

  7. #7
    Registered User
    Join Date
    02-20-2009
    Location
    McKinney, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help getting my syntax correct

    I made it work by putting each type on shipping in a different cell (it shows both totals) then adding a check box to the cell.

    THANK YOU!!

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

    Re: Help getting my syntax correct

    I am not sure why it wouldn't have worked the original way..

    If Cell A1 has the 2 options in a drop down, and B1 has the number of items, then C1 should come up with the correct corresponding dollar figure... using that formula...

  9. #9
    Registered User
    Join Date
    02-20-2009
    Location
    McKinney, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help getting my syntax correct

    I just haven't tried the suggestion in your last post yet. Thank you.

+ 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