![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: tucson
Posts: 94
|
I need to have a formula that calculates a total based on a sliding scale, i.e. the cost per thousand goes down as the quantity increases. If total quantity ordered is less than 2500, the cost per 1,000 is "A", 2501-5000 the cost is "B",5001-7500 the cost is "C" and 7500+, the cost is "D". Is there an easy formula for this argument?
Thank you |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Use a VLOOKUP function to determine cost/1000...
=VLOOKUP(A2,{0,"A";2501,"B";5001,"C";7501,"D"},2) ...where A2 contains your Quantity. [ This Message was edited by: Mark W. on 2002-04-25 11:57 ] |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
You could also use a not-too-lenghy if-statment (looking at A2 for quantity):
=(A2/1000)*(IF(A2<2500,A2*CostA,IF(A2<5000,CostB,IF(A2<7500,CostC,CostD)))) Where CostA,CostB,CostC,and CostD are your cost values per 1000 units. Hope that helps, Adam |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: tucson
Posts: 94
|
Thank you Asala42. That worked brilliantly !
|
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
=(A2/1000)*(IF(A2<2500,A2*CostA,IF(A2<5000,CostB,IF(A2<7500,CostC,CostD)))) Or, use... =A2/1000*VLOOKUP(A2,{0,CostA;2501,CostB;5001,CostC;7501,CostD},2) [ This Message was edited by: Mark W. on 2002-04-25 12:14 ] |
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
Doh!
Good call, Mark. *slaps self* Adam |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|