ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Rounding up for down based on cell value (https://www.excelbanter.com/excel-worksheet-functions/12106-rounding-up-down-based-cell-value.html)

Allison

Rounding up for down based on cell value
 
I'd like to be able to enter a dollar amount (say A1 = $22.05) and then have
8 cells display dollar amounts that add up to A1. Is there a function that
would round up or down the correct number of cells (to two decimal places) to
equal $22.05?

JE McGimpsey

one way, if I understand you correctly:

A1: 22.05
A2: =ROUND(A1/8,2)
A3-A8: =A$2
A9: =A1-SUM(A2:A8)


In article ,
"Allison" wrote:

I'd like to be able to enter a dollar amount (say A1 = $22.05) and then have
8 cells display dollar amounts that add up to A1. Is there a function that
would round up or down the correct number of cells (to two decimal places) to
equal $22.05?


Allison

That's close to what I was looking for. Instead of having the last cell just
being what's left though, I'd like to have the cells distributed as evenly as
possible. For example, using the $22.05 from before, I'd like to end up with
5 cells that say $2.76 and 3 that say $2.75. Is that possible?

"JE McGimpsey" wrote:

one way, if I understand you correctly:

A1: 22.05
A2: =ROUND(A1/8,2)
A3-A8: =A$2
A9: =A1-SUM(A2:A8)


In article ,
"Allison" wrote:

I'd like to be able to enter a dollar amount (say A1 = $22.05) and then have
8 cells display dollar amounts that add up to A1. Is there a function that
would round up or down the correct number of cells (to two decimal places) to
equal $22.05?



JE McGimpsey

THis seems to work fairly well. I'm not sure it's necessarily
generalizable for other numbers of cells:

A1: 22.05
A2: =ROUND(A1/8,2)
A3: =ROUND(-SUM(-$A$1,$A$2:A2)/(10-ROW()),2)

Copy A3 down to A9

In article ,
"Allison" wrote:

That's close to what I was looking for. Instead of having the last cell just
being what's left though, I'd like to have the cells distributed as evenly as
possible. For example, using the $22.05 from before, I'd like to end up with
5 cells that say $2.76 and 3 that say $2.75. Is that possible?



All times are GMT +1. The time now is 11:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com