Dividing a cell and returning variable results with in a Table

WilliamPorter

New Member
Joined
Aug 5, 2021
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hello Excel Gurus!

I have a table that I'm trying to build. I have seen what I'm trying to do be done in an excel sheet but can not find a reference of it being done within a table.

I am running into the issue that when a number is divided out it is not equal so the pennies need to be added to variable cells.

I've used this posthttps://www.mrexcel.com/board/threads/dividing-a-number-and-returning-variable-results.485265/ and can get it to work on a sheet with set cells.

I need something this is dynamic, that I can use as a template, doesn't matter if it has 5 or 500 rows.

Can someone please help me develop a formula or give me some insight?

Thanks for your time.

1628521283723.png

This happens because of how the taxes are not an even spread.
1628521425530.png


So i took the range and added a round down function so that would not happen
1628521540341.png


I'd like to be able to add the remaining $0.05 to varaible cells.
1628521801117.png



New Billing SS Proposal - Example - WP.xlsx
ABCDEFGHIJK
1NumberUsernamesCost per LineEqupimentShippingInternationalTaxTotal Cost Per LineSummary
2xxxxxxxyz$1.15$1.15Bill Cycle06/19/21 - 07/18/21
3xxxxxxxyz$50.00$1.15$51.15Balance Forward
4xxxxxxxyz$50.00$15.00$5.00$1.15$71.15New Usage3.00
5xxxxxxxyz$50.00$1.15$51.15Recurring Charges600.00
6xxxxxxxyz$50.00$1.15$51.15Non-recurring Charges20.00
7xxxxxxxyz$50.00$1.15$51.15Taxes and Surcharges15.00
8xxxxxxxyz$50.00$3.00$1.15$54.15Adjustments
9xxxxxxxyz$50.00$1.15$51.15Total New Charges638.00
10xxxxxxxyz$50.00$1.16$51.16Total Amount Due$638.00
11xxxxxxxyz$50.00$1.16$51.16Due Date7/4/21
12xxxxxxxyz$50.00$1.16$51.16
13xxxxxxxyz$50.00$1.16$51.16
14xxxxxxxyz$50.00$1.16$51.16
15SubTotal$600.00$15.00$5.00$3.00$15.00$638.00
16One Time Adjustments$0.00
17Grand Total$600.00$15.00$5.00$3.00$15.00$638.00
Master
Cell Formulas
RangeFormula
G2:G9G2=ROUNDDOWN(Taxes/ROWS([Tax]),2)
C15C15=SUBTOTAL(109,[Cost per Line])
D15D15=SUBTOTAL(109,[Equpiment])
E15E15=SUBTOTAL(109,[Shipping])
F15F15=SUBTOTAL(109,[International])
G15G15=SUBTOTAL(109,[Tax])
H2:H14H2=SUM(Bill9[@[Cost per Line]:[Tax]])
H15H15=SUBTOTAL(109,[Total Cost Per Line])
H16H16=SUM(C16:G16)
C17C17=Bill9[[#Totals],[Cost per Line]]
D17D17=Bill9[[#Totals],[Equpiment]]
E17E17=Bill9[[#Totals],[Shipping]]
F17F17=Bill9[[#Totals],[International]]
G17G17=Bill9[[#Totals],[Tax]]
H17H17=SUM(Bill9[[#Totals],[Total Cost Per Line]]+H16)
Named Ranges
NameRefers ToCells
Taxes=Master!$K$7G2:G9
 

Attachments

  • 1628521122224.png
    1628521122224.png
    184.5 KB · Views: 13
  • 1628521360844.png
    1628521360844.png
    210.9 KB · Views: 9

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
One way you could do it is with a helper cell that contains

=G2-LEFT(G2,FIND(".",G2,1)+2)

So you can get the remainder of each cell. Then, sum the remainders, round the total up, and add it to a line item
 
Upvote 0
It's definitely a pain dealing with row based formulas in a table, but you could do something like this:

Book1
NOPQ
1NumberTaxTax
2xxxxxx1.1515.00
3xxxxxx1.15
4xxxxxx1.15
5xxxxxx1.15
6xxxxxx1.15
7xxxxxx1.15
8xxxxxx1.15
9xxxxxx1.15
10xxxxxx1.16
11xxxxxx1.16
12xxxxxx1.16
13xxxxxx1.16
14xxxxxx1.16
15
1615.00
Sheet23
Cell Formulas
RangeFormula
O2:O14O2=IF(ROW()=ROW(INDEX([Tax],1)),ROUNDDOWN(Taxes/ROWS([Tax]),2),ROUNDDOWN((Taxes-SUM(INDEX([Tax],1):INDEX([Tax],ROW()-ROW(INDEX([Tax],1)))))/(ROWS([Tax])-(ROW()-ROW(INDEX([Tax],1)))),2))
O16O16=SUM(Table1[Tax])
Named Ranges
NameRefers ToCells
Taxes=Sheet23!$Q$2O2:O14
 
Upvote 0
It's definitely a pain dealing with row based formulas in a table, but you could do something like this:

Book1
NOPQ
1NumberTaxTax
2xxxxxx1.1515.00
3xxxxxx1.15
4xxxxxx1.15
5xxxxxx1.15
6xxxxxx1.15
7xxxxxx1.15
8xxxxxx1.15
9xxxxxx1.15
10xxxxxx1.16
11xxxxxx1.16
12xxxxxx1.16
13xxxxxx1.16
14xxxxxx1.16
15
1615.00
Sheet23
Cell Formulas
RangeFormula
O2:O14O2=IF(ROW()=ROW(INDEX([Tax],1)),ROUNDDOWN(Taxes/ROWS([Tax]),2),ROUNDDOWN((Taxes-SUM(INDEX([Tax],1):INDEX([Tax],ROW()-ROW(INDEX([Tax],1)))))/(ROWS([Tax])-(ROW()-ROW(INDEX([Tax],1)))),2))
O16O16=SUM(Table1[Tax])
Named Ranges
NameRefers ToCells
Taxes=Sheet23!$Q$2O2:O14
This is exactly what I'm looking for. I did have an issue with it loosing a penny here and there I made the following adjustment and now it seems to work. Thank you so much for you help!

=IF(ROW()=ROW(INDEX([Tax],1)),ROUNDDOWN(Taxes/ROWS([Tax]),2),ROUND((Taxes-SUM(INDEX([Tax],1):INDEX([Tax],ROW()-ROW(INDEX([Tax],1)))))/(ROWS([Tax])-(ROW()-ROW(INDEX([Tax],1)))),2))
 
Upvote 0

Forum statistics

Threads
1,215,479
Messages
6,125,041
Members
449,206
Latest member
Healthydogs

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