Forum Discussion

deniztopcu's avatar
deniztopcu
Brass Contributor
Oct 21, 2024
Solved

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...
  • m_tarler's avatar
    m_tarler
    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,""))

     

     

     

Resources