Created
May 15, 2023 07:59
-
-
Save Softwaretrain/f5a005b4d907b910217617f35572d17e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SplitAmount | |
=ArrayFormula(LET( | |
z,division, | |
count,ROUNDUP(amount/z,), | |
a,SCAN(0,count,LAMBDA(x,y,x+y))-count+1, | |
b,SEQUENCE(SUM(count)), | |
c,SCAN(0,b,LAMBDA(g,h,XLOOKUP(h,a,array,g))), | |
e,BYROW(amount,LAMBDA(x,LET(n,z,a,MOD(x,n),b,REPT(n&"-",x/n)&IF(a,a,""),b))), | |
f,TEXTJOIN(",",,e), | |
g,TOCOL( ArrayFormula(split(transpose(SPLIT(f,",")),"-")),1), | |
h,HSTACK(c,g),h)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment