Rounding the sum of a named range

Yamezz

Active Member
Joined
Nov 22, 2006
Messages
372
Office Version
  1. 365
I use Excel for invoicing products. I have just encountered a problem with rounding with a certain combination of products.

This is what my display looks like currently:
QuantityDescriptionAccountAmountWETGST
62023 Sparkling RoséDirect Sales$114.55$18.27$11.45
62024 Sparkling VermentinoDirect Sales$114.55$18.27$11.45
Subtotal$229.09
WET (included)$36.54
GST$22.90
Total$251.99


This is what I would like to display:
QuantityDescriptionAccountAmountWETGST
62023 Sparkling RoséDirect Sales$114.55$18.27$11.45
62024 Sparkling VermentinoDirect Sales$114.55$18.27$11.45
Subtotal$229.10
WET (included)$36.54
GST$22.90
Total$252.00


This is the actual data behind the displayed table
QuantityDescriptionAccountAmountWETGST
62023 Sparkling RoséDirect Sales114.545454518.2711.45
62024 Sparkling VermentinoDirect Sales114.545454518.2711.45
=IF(A4<>"",IF(C4="Samples",0,A4*(VLOOKUP(SaleCustomer,'Love and Glory.xlsm'!TableCustomerDetails[#Data],9,FALSE))),"")
=IF(A5<>"",IF(C5="Samples",0,A5*(VLOOKUP(SaleCustomer,'Love and Glory.xlsm'!TableCustomerDetails[#Data],9,FALSE))),"")
=IF(A6<>"",IF(A6="Samples",0,A6*(VLOOKUP(SaleCustomer,'Love and Glory.xlsm'!TableCustomerDetails[#Data],9,FALSE))),"")
Subtotal229.0909091
WET (included)36.54
GST22.9
Total251.99

The values of 114.5454545 are the result of a formula, which is shown in the unused rows below. The values are so many decimal places because they are actually calculated from a retail price less 10% GST, in this case $126/1.1

When I invoice 12 bottles of one product, I get a Subtotal of $229.10, but when I invoice 6 bottles + 6 bottles, I get a Subtotal of $229.09. This is calculated with =SUM(SaleAmountColumn)

To get to the required $229.10 value I have tried both =SUM(ROUND(SaleAmountColumn,2)) and the individual cells =SUM(ROUND(D2,2),ROUND(D3,2),ROUND(D4,2),ROUND(D5,2),ROUND(D6,2)) but the formulas in the unused rows result in a #VALUE! error

How can I achieve a consistent $229.10 regardless of entering 1 lot of 12 bottles, or 2 lots of 6?
 
How about, I am not sure, but still please check:
Book1
ABC
1114.5454545114.5454545
2114.5454545114.5454545
3229.10229.10
Sheet2
Cell Formulas
RangeFormula
A3A3=CEILING( SUBTOTAL(9,A1:A2), 0.01)
C3C3=ROUND(C1, 2) + ROUND(C2, 2)
 
Upvote 0
I would round the original calculation.
Rich (BB code):
=IF(A4<>"",IF(C2="Samples",Round(0,A2*(VLOOKUP(SaleCustomer,'Love and Glory.xlsm'!TableCustomerDetails[#Data],9,FALSE),2))),"")
 
Upvote 0
Solution
I would round the original calculation.
Rich (BB code):
=IF(A4<>"",IF(C2="Samples",Round(0,A2*(VLOOKUP(SaleCustomer,'Love and Glory.xlsm'!TableCustomerDetails[#Data],9,FALSE),2))),"")
Thanks Alex, that's obvious in hindsight!

@Sam_D_Ben Your answer works for the example I gave you, but I realised I also have occasions where I end up with $X.01, when it should be rounded down. Thanks for your input though.
 
Upvote 0
Thanks for the feedback. Glad we could help.
PS: in terms of what you were trying initially this might work in Excel 2019
Excel Formula:
=SUMPRODUCT(ROUND(SaleAmountColumn,2))
 
Upvote 0

Forum statistics

Threads
1,226,849
Messages
6,193,330
Members
453,790
Latest member
yassinosnoo1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top