finding colum ref.

justme1122

New Member
Joined
Mar 6, 2011
Messages
47
Hi

Im a little bit stuck with he next step in the formular Im working on:

=SUM(IF(INDIRECT(J$3&"!$B:$B")=Members!$A4,INDIRECT(J$3&"!$M:$M"),0))

Im trying to make the red bit conditional, guess the long way to right it would be:

=if(J1=A1,A:A,if(J1=B1,B:B,if(J1=C1,C:C,............................

Could someone please suggest a formular to do this.

Thanks
Scott
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Does J1 contain the column letter to look at then?

If so:


=SUM(IF(INDIRECT(J$3&"!"&J1&":"&J1)=Members!$A4,INDIRECT(J$3&"!$M:$M"),0))
 
Upvote 0
Thanks for the reply but its not quite that simple:

J1 if produced by a macro that lists sheet names.

sheets are imported by a macro.

Also to get J1 to = A1 (or any other) Ill need a left() function but I can work that bit out for myself.
 
Upvote 0
Maybe:

Code:
=SUMIF(INDEX(INDIRECT(J$3&"!$A:$L"),0,MATCH(J1,$A$1:$A$12,0)),Members!$A4,INDIRECT(J$3&"!$M:$M"))
 
Upvote 0
Thanks for the reply oaktree but that isnt working for me.

Iv never used index/match but from the best I can tell there is no posiblilty for A:A to change to B:B in that formular.
 
Upvote 0
...there is no posiblilty for A:A to change to B:B in that formular

Instead of your formula referencing the text "A:A" or "B:B", the INDEX(INDIRECT(J$3&"!$A:$L"),0,MATCH(J1,$A$1:$A$12,0)) construct will reference the 1st, 2nd, ..., 12th column according to where J1 is found in the range A1:A12.

Probably just needs a tweak to be MATCH(J1,$A$1:$L$1,0).
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top