Forum Discussion
gdougher
Dec 29, 2022Copper Contributor
SUM of numbers in a sequence
Hello. I have a billing report in Excel that I use to enter claims in a state system. The system requires me to enter a record for each date, along with the number of hours and the total amount. Ho...
Patrick2788
Jan 03, 2023Silver Contributor
If you're on 365 with access to LAMBDA, there's an elegant solution available.
First, I created dynamic ranges for Service date, hours, and amount.
Created a named item for the Header:
={"Date From", "Date To", "Hours", "Amount"}
Obtained the Week Number:
=MAP(sdate, LAMBDA(e, WEEKNUM(e)))
Summarize LAMBDA:
=LAMBDA(a,v,LET(
f, FILTER(HSTACK(sdate, hours, amount), WNum = v),
VSTACK(a, HSTACK(MIN(TAKE(f, , 1)), MAX(f), SUM(TAKE(DROP(f, , 1), , 1)), SUM(TAKE(f, , -1))))
))
Sheet level formula:
=REDUCE(Header,UNIQUE(WNum),Summarize)