Thread: [Solved] Round num_digits calculated?
View Single Post
 
Old 08-03-2016, 12:08 PM
gebobs gebobs is offline Windows 7 64bit Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default Round num_digits calculated?

Is it possible to use a formula within the round function to determine the rounding number of digits?

For this application, a suppliers price for any SKU is dependent on the dimensions which can vary widely thus it's easiest to calculate the price. The problem I have is when calculating a supplier's price, most suppliers use a price with four decimals, one uses three, and another uses two.

Initially, I had this which works fine for all but the two that use fewer digits.

=ROUND([price calculation],4)

I tried making a lookup table with the suppliers and their rounding then vlookup in the formula as follows, but I get a #REF! error.

=ROUND([price calculation],VLOOKUP([@Supplier],Round,2))

I tried using an IF, but I get the same #REF! error.

=ROUND([price calculation],IF([@Supplier]="H",2,4))

Anyone have any bright ideas? I have attached the workbook if you dare.
Attached Files
File Type: xlsx Rounding.xlsx (22.5 KB, 11 views)
Reply With Quote