Search code examples
arraysgoogle-sheetslambdasumgoogle-sheets-formula

Sumif (google sheets) but data is every nth cell in a column, every nth column based on cell n-4


Im trying to make a budget tracker enter image description here

Is there a way i can sum every nth cell in a column if the n-4 is a specific string?

I found this but not sure how i can add a "=person A" to the criteria.

Is there a better way to format this data ?


Solution

  • try in C2 and drag to the right:

    =INDEX(BYROW(REGEXREPLACE($A2:$A3, "(?i)total ", ), 
     LAMBDA(T, SUM(IFNA(FILTER(C7:C15, C4:C12=T))))))
    

    enter image description here

    ⠀‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀