Formula

%3CLINGO-SUB%20id%3D%22lingo-sub-2051503%22%20slang%3D%22en-US%22%3EFormula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2051503%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3BHi%20guys%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20help%20will%20be%20very%20much%20appreciated%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewrite%20a%20formula%20that%20will%20automatically%20calculate%20total%20price%20for%20any%20amount%20of%20units%20placed%20in%20C12.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20will%20not%20allow%20me%20to%20post%20my%20screenshot%20for%20some%20reason%3A%20So%20I%20will%20explain%20best%20I%20can.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EB5%20(unit%20quantity)%20C5%20(Price%20per%20unit)%3C%2FP%3E%3CP%3EB6%20Below%205%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BC6%2036%3C%2FP%3E%3CP%3EB7%205-10%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20C7%2034%3C%2FP%3E%3CP%3EB8%2011-30%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20C8%2031%3C%2FP%3E%3CP%3EB9%2031-50%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20C9%2026%3C%2FP%3E%3CP%3EB10%2051%20above%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20C10%2020%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EB12%20%23%20of%20units%3C%2FP%3E%3CP%3EB13%20Total%20price%20(write%20formula%20here)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2051503%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2051543%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2051543%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F504646%22%20target%3D%22_blank%22%3E%40Val-09%3C%2FA%3E%26nbsp%3BBecause%20of%20the%20way%20you%20have%20the%20table%20set%20up%20you%20make%20it%20difficult.%26nbsp%3B%20For%20example%20all%20your%20quantities%20are%20text%20based%20ranges%20and%20you%20%22Below%205%22%20is%20exclusive%20range%20while%20all%20your%20other%20ranges%20are%20inclusive%20ranges%20(i.e.%20the%20range%20includes%20that%20number).%26nbsp%3B%20If%20the%20table%20was%20set%20up%20as%3C%2FP%3E%3CP%3EQTY%20%26lt%3B%3D%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BPrice%3C%2FP%3E%3CP%3E4%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2036%3C%2FP%3E%3CP%3E10%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2034%3C%2FP%3E%3CP%3E30%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2031%3C%2FP%3E%3CP%3E50%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2026%3C%2FP%3E%3CP%3Emore%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B20%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethen%20you%20could%20use%20a%20simple%20lookup%20function%20like%20XLOOKUP%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DC12*XLOOKUP(C12%2CB6%3AB10%2CC6%3AC10%2C%2C1%2C1%20)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ewhich%20means%20if%20you%20change%20the%20numbers%20in%20the%20table%20they%20automatically%20adjust.%3C%2FP%3E%3CP%3EIf%20you%20can't%20or%20don't%20want%20to%20change%20the%20table%20format%20then%20in%20C13%20you%20can%20force%20a%20formula%20like%20this%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DC12*IFS(C12%26lt%3B5%2CC6%2CC12%26lt%3B%3D10%2CC7%2CC12%26lt%3B%3D30%2CC8%2CC12%26lt%3B%3D50%2CC9%2CTRUE%2CC10)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
New Contributor

 Hi guys,

 

Your help will be very much appreciated:

 

write a formula that will automatically calculate total price for any amount of units placed in C12.

 

It will not allow me to post my screenshot for some reason: So I will explain best I can.

 

B5 (unit quantity) C5 (Price per unit)

B6 Below 5           C6 36

B7 5-10                C7 34

B8 11-30              C8 31

B9 31-50              C9 26

B10 51 above      C10 20

 

B12 # of units

B13 Total price (write formula here)

 

2 Replies

@Val-09 Because of the way you have the table set up you make it difficult.  For example all your quantities are text based ranges and you "Below 5" is exclusive range while all your other ranges are inclusive ranges (i.e. the range includes that number).  If the table was set up as

QTY <=     Price

4                36

10              34

30              31

50              26

more         20

 

then you could use a simple lookup function like XLOOKUP 

=C12*XLOOKUP(C12,B6:B10,C6:C10,,1,1 )

which means if you change the numbers in the table they automatically adjust.

If you can't or don't want to change the table format then in C13 you can force a formula like this:

=C12*IFS(C12<5,C6,C12<=10,C7,C12<=30,C8,C12<=50,C9,TRUE,C10)

Thank you so much for your help! @mtarler