# Reference "This Cell's Column" in Google Sheets

(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)

• Despite your post description, what you are trying to do is not clear (at least not to me). In addition, any time I hear someone has this many columns, I have to question the overall design; there is most always a simpler approach. If you care to share a link to the sheet (or to a copy of the sheet), that would at least make the goal clearer (and may also lead to suggestions for a simpler setup). Dec 26, 2021 at 22:47
• Thanks, yeah as a complete amateur at using sheets, we just did the best we could to try to track everyone's rewards in a large event, there is no uniformity to the postings. I added in a link to the copy of the sheet. Dec 27, 2021 at 0:49