How do I refer to a sheet name in this formula?

bigpat

New Member
Joined
Nov 28, 2012
Messages
24
I have a formula: =SUMIF(DINOSAUR!$C$12:$C$37,K$3,DINOSAUR!$A$12:$A$37) where DINOSAUR is the name of another sheet in my workbook (it's also the name of a clinical trial)

But the name also appears in cell F4 as shown here. Now I need to replicate this formula down the sheet for many other studies. How can I refer to cell F4 in this formula so that it will refer to the next sheet each time? I have made sure that the sheet names exactly match the entries in column F.

I tried simply replacing DINOSAUR with F4, I have also tried quotes and square brackets, but I can't make it work.

Ideally the formula should allow for spaces in the sheet names, but if that's a problem I can RenameThemLikeThis.


yAZ1xvc.jpg
[/URL][/IMG]
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Use INDIRECT.

=SUMIF(INDIRECT("'"&F4&"'!$C$12:$C$37"), K$3, INDIRECT("'"&F4&"'!$A$12:$A$37"))
 
Upvote 0
Use INDIRECT.

=SUMIF(INDIRECT("'"&F4&"'!$C$12:$C$37"), K$3, INDIRECT("'"&F4&"'!$A$12:$A$37"))

Fantastic - thank you! I'd never heard of INDIRECT before and I need to read up little on it, especially to wrap my head round all those quotes. It seems a weird name for it! I needed to make it $F4 but I hadn't clarified that I need the formula to replicate across other columns too. But I figured that part out.

Thanks again. This is a big help.
 
Upvote 0
All those quotes are only really there in case you have a sheet name with a space, you could remove them but it's probably worth keeping them just in case.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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