I want to divide a single number between multiple cells

kingfisher225

New Member
Joined
Aug 16, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello, I want to take a singular number say 300,000 and divide it between multiple cells. I am looking to make each cells value 1400. Theoretically this would break it down for me and then leave one at the end that would have an odd number. not really sure what to do
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
How about this?

VBA Code:
Sub THK()
Dim stp As Long: stp = 1400
Dim Total As Long: Total = 300000
Dim c As Long: c = Total / stp
Dim r As Long: r = Total Mod stp
Dim lr As Long: lr = c + 1

Range("A1:A" & lr - 1).Value2 = stp
Range("A" & lr).Value = r

End Sub
 
Upvote 0
So say 300000 is divided by 1400 you would have 214 cells with 1400 and remainder 400. Do you want 214 cell to represent 1400 and one 400????

It will be a formula based solution??
 
Upvote 0
just for fun with Power Query
it can be optimised
Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
    Int = Table.AddColumn(Source, "Div", each Number.IntegerDivide([Column1], [Column2]), Int64.Type),
    Last = Table.AddColumn(Int, "Last", each [Column1]-[Column2]*[Div]),
    Grp = Table.Group(Table.ExpandListColumn(Table.AddColumn(Last, "Custom.1", each {1..214}), "Custom.1"), {"Column1"}, {{"Count", each _, type table}}),
    Extract1400 = Table.TransformColumns(Table.AddColumn(Grp, "Custom", each [Count][Column2]), {"Custom", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    Split = Table.SplitColumn(Extract1400, "Custom", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), Int[Div]{0}),
    ExtractLast = Table.TransformColumns(Table.AddColumn(Split, "Custom", each List.Distinct([Count][Last])), {"Custom", each Text.Combine(List.Transform(_, Text.From)), type text})
in
    ExtractLast
Column1Column2
3000001400
Column1Custom.1Custom.2Custom.3Custom.4Custom.5Custom.6Custom.7Custom.8Custom.9Custom.10Custom.11Custom.12Custom.13Custom.14Custom.15Custom.16Custom.17Custom.18Custom.19Custom.20Custom.21Custom.22Custom.23Custom.24Custom.25Custom.26Custom.27Custom.28Custom.29Custom.30Custom.31Custom.32Custom.33Custom.34Custom.35Custom.36Custom.37Custom.38Custom.39Custom.40Custom.41Custom.42Custom.43Custom.44Custom.45Custom.46Custom.47Custom.48Custom.49Custom.50Custom.51Custom.52Custom.53Custom.54Custom.55Custom.56Custom.57Custom.58Custom.59Custom.60Custom.61Custom.62Custom.63Custom.64Custom.65Custom.66Custom.67Custom.68Custom.69Custom.70Custom.71Custom.72Custom.73Custom.74Custom.75Custom.76Custom.77Custom.78Custom.79Custom.80Custom.81Custom.82Custom.83Custom.84Custom.85Custom.86Custom.87Custom.88Custom.89Custom.90Custom.91Custom.92Custom.93Custom.94Custom.95Custom.96Custom.97Custom.98Custom.99Custom.100Custom.101Custom.102Custom.103Custom.104Custom.105Custom.106Custom.107Custom.108Custom.109Custom.110Custom.111Custom.112Custom.113Custom.114Custom.115Custom.116Custom.117Custom.118Custom.119Custom.120Custom.121Custom.122Custom.123Custom.124Custom.125Custom.126Custom.127Custom.128Custom.129Custom.130Custom.131Custom.132Custom.133Custom.134Custom.135Custom.136Custom.137Custom.138Custom.139Custom.140Custom.141Custom.142Custom.143Custom.144Custom.145Custom.146Custom.147Custom.148Custom.149Custom.150Custom.151Custom.152Custom.153Custom.154Custom.155Custom.156Custom.157Custom.158Custom.159Custom.160Custom.161Custom.162Custom.163Custom.164Custom.165Custom.166Custom.167Custom.168Custom.169Custom.170Custom.171Custom.172Custom.173Custom.174Custom.175Custom.176Custom.177Custom.178Custom.179Custom.180Custom.181Custom.182Custom.183Custom.184Custom.185Custom.186Custom.187Custom.188Custom.189Custom.190Custom.191Custom.192Custom.193Custom.194Custom.195Custom.196Custom.197Custom.198Custom.199Custom.200Custom.201Custom.202Custom.203Custom.204Custom.205Custom.206Custom.207Custom.208Custom.209Custom.210Custom.211Custom.212Custom.213Custom.214Custom
3000001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400140014001400400
 
Upvote 0
A way with new Excel 365 dynamic array function.

Book1
CDEFGH
1ListRemainder
2Number:100001400200
3Divisor:14001400
4Cycles:71400
51400
61400
71400
Sheet4
Cell Formulas
RangeFormula
H2H2=MOD(D2,D3)
D4D4=INT(D2/D3)
F2:F8F8=SEQUENCE(D4,,D3,0)
D4D4=INT(D2/D3)
 
Upvote 0
More fun with Power Query.

Code:
let
    Div = 1400,
    Total = 300000,
    Times = Int64.From(Total / Div),
    Source = Table.FromList(List.Transform(List.Generate(()=>0, each _ < Times, each _ + 1), each Div), Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    Last = Table.InsertRows(Source, Table.RowCount(Source), {[Column1=Number.Mod(Total, Div)]})
in
    Last
 
Upvote 0

Forum statistics

Threads
1,215,044
Messages
6,122,827
Members
449,096
Latest member
Erald

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