I'm looking at a large volume of data where there are multiple (more than) 40 columns for client benefits that are not all to be included in a calculation, e.g:
| Client | Ben1 | Ben1_Inc | Ben2 | Ben2_Inc | Ben3 | Ben3_Inc | Ben# | Ben#_Inc |
| x | 1000 | Y | 1100 | Y | 1200 | N | | |
| y | | | 1200 | N | 1500 | Y | | |
If a benefit is only to be included in the calculation when the name of the subsequent column is the column name with a "_Inc" suffix
It would be possible to achieve this using a formula tool with a formula for each specific benefit column with the syntax
Output column [Ben1]
IF [Ben1_Inc] = "Y" THEN
[Ben1]
ELSE
0
IF
However, as each of the benefit columns has a different name (i,e. not nicely named Ben#), this will be a very tedious process, as all (more than 40) formula will have to be manually constucted.
Is there a way to reference multiple "generic" / "dynamic" columns in a formula, e.g.
Output column [column]
If ([column] + "_Inc") ="Y" THEN
[column]
ELSE
0
END IF
So if we're in column number X and the name of column number X+1 has the "_Inc" suffix then change the data in column X based on the data in column X+1...
Thanks in advance!