Forum Discussion
deniztopcu
Oct 21, 2024Brass Contributor
Converting Periodic Data to Quarterly Data
hi, As seen in the attached example file, I obtain quarterly data in the range "C179:T214" by manually processing the periodic data in the range "AA179:AV214". Quarterly data is obtained as follows...
- Oct 21, 2024
deniztopcu So if you want a more general solution using lookups for each you can do this:
=LET(Rvals,$A$179:$A$214,Cvals,$C$1:$U$1, luTable,$AA$179:$AT$214,luRows,$X$179:$X$214, luCols,$AA$109:$AT$109, factor,$C$2:$U$2*$A$5, MAKEARRAY(ROWS(Rvals),COLUMNS(Cvals),LAMBDA(r,c,LET( rr,FILTER(luTable,INDEX(Rvals,r)=luRows),cc,XMATCH(INDEX(Cvals,c),luCols), (INDEX(rr,cc)-IF(RIGHT(INDEX(Cvals,c),1)="3",0,INDEX(rr,cc+1)))/INDEX(factor,c)))) )basically the first 3 lines define each of the areas, then a MAKEARRAY
then line 5 finds the row of data and which column
then line 6 does the calculation
if that isn't what you wanted and you just want to do 1 row at a time using the prior formula just pass it the corresponding row:
=IFERROR(($AA$179:$AS$179-IF(RIGHT(C$1:U$1,1)="3",0,$AB$179:$AT$179))/C$2:U$2/$A$5,"")or if you need to do a lookup but only doing 1 row at time then:
=LET(rr, FILTER($AA$179:$AT$214,A179=$X$179:$X$214),IFERROR((DROP(rr,,-1)-IF(RIGHT(C$1:U$1,1)="3",0,DROP(rr,,1)))/C$2:U$2/$A$5,""))
m_tarler
Oct 21, 2024Bronze Contributor
I don't know if I'm qualified to answer that but I believe a single formula would have a tiny bit smaller memory footprint. In terms of processing speed that would be a whole other consideration and I know sometimes the LAMBDA helper functions were slower and there are some here that have successfully used Thunks (basically defining a 'skeleton' LAMBDA function as a variable) and then only at the end apply the values for the Thunks to act on with great improvements in processore speeds but hopefully your sheet isn't in the realm where this sort of exercise is necessary.
deniztopcu
Oct 21, 2024Brass Contributor