ETA: using Excel for Microsoft 365 MSO
I have a sheet ("Enrollment Input") with multiple named ranges that have identical column headers (which are user defined in the "Client Setup" tab) and each row of data represents a different month. I then have all the possible named ranges listed in a different sheet with a yes/no dropdown for the user to be able to select which of the named ranges that want included in the totals. Note that the named ranges start with the word "Table" but they are just named ranges, not tables.
If only looking at using one named range of data, I would use this formula:
This formula is working correctly in that it's looking at the named range that I have in X3, and returning the correct column from my option of column labels based on what they entered in C6 and the correct month in B7.=INDEX(INDIRECT($X$3),MATCH($B7,'Enrollment Input'!$A$3:$A$75,0),MATCH(C$6,ColumnLabelsEnrollment,0))
However, I have all the possible named ranges listed in X3 thru X12. I want the user to enter in column W "yes" or "no" on which ones they want included - so they may say Yes in W3 and W5, which I then want the formula to add up the "MATCH($B7,'Enrollment Input'!$A$3:$A$75,0),MATCH(C$6,ColumnLabelsEnrollment,0)" portion of the formula with the indirect(X3) and indirect(X5). I suppose I can do a whole bunch of nested if statements to check for the "yes"ses but I'm thinking there should be a more sophisticated way to do this, and also leave the door open to add more named ranges in the future. I tried using a sumproduct looking for if column W is yes but that didn't work either....
uploading by workbook. please look at "Plan Totals Exhibit cell C7. This formula works but it will require that I update it each time I add a new named range and I'm hoping for a more sophisticated way to do this that the formula looks thru all of the names in the range instead of one at a time.
goal of this is to end up being a template for other users to be able to populate data, so trying to avoid the user having to run any macros.
Really appreciate any assistance!