https://docs.google.com/spreadsheets/d/1LG7AgcumhfQ1ZV0Em_oVjdPdrLCP-5CWWrw0WV1oCnY/edit?usp=sharing
(We have to track 3 separate point totals for everyone who has participated in each game, game rewards are not formatted in a uniform manner, so we have to manually parse everything to figure out what character was rewarded which kind of points).
I Have three formulas I need populated across a massive range, repeating, but the formulas need to reference the current cell's column header.
For example:
=IF(REGEXMATCH($B4,INDIRECT("G1")),$C4,0)
=IF(REGEXMATCH($B4,INDIRECT("H1")),$D4,0)
=IF(REGEXMATCH($B4,INDIRECT("I1")),$E4,0)
And on and on...
=IF(REGEXMATCH($B4,INDIRECT("CJ1")),$C4,0)
=IF(REGEXMATCH($B4,INDIRECT("CK1")),$D4,0)
=IF(REGEXMATCH($B4,INDIRECT("CL1")),$E4,0)
(CJ1, CK1, and CL1 all contain the same info, so if I could do an =IF(REGEXMATCH($B4,INDIRECT(THISCOLUMNHEADER)),$C4,0) that would be perfect.)
Then the next set of 3 columns of cells would need to be
=IF(REGEXMATCH($B4,INDIRECT("CM1")),$C4,0)
=IF(REGEXMATCH($B4,INDIRECT("CN1")),$D4,0)
=IF(REGEXMATCH($B4,INDIRECT("CO1")),$E4,0)
again, CM1, CN1 and CO1 all contain the same header.
I need to repeat this ad nauseum across about a thousand columns, each of which the header changes every third cell. Even if I had to use some sort of step loop to increment the indirect cell reference. (Then I can just auto populate all the rows based on the formula, which are also about 1000 deep)