Counting data from range in mulitple sheets

circlesecretary

New Member
Joined
Jul 7, 2011
Messages
17
I have a workbook with multiple sheets (2003) and on my last sheet I need to have the total amount of times each code (R1-R24, A1-A22, etc.) was used within the range of N4:U6 of each sheet.

I thought I found the perfect formula for this here --> http://www.mrexcel.com/forum/showthread.php?t=503785&highlight=count+key+words+multiple+sheets

I assigned a named range for my "Sheets" and came up with this-
=SUMPRODUCT(COUNTIF(INDIRECT("""&Sheets&""!N4:U6"),"R1"))

I got back#REF!. That's when I decided that R1 wouldn't work because it's the name of a cell! So I changed it to "Peer1" and changed "R1" to "Peer1" within range.... but it still says #REF!.

=SUMPRODUCT(COUNTIF(INDIRECT("""&Sheets&""!N4:U6"),"Peer1"))

Any suggestions?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
=SUMPRODUCT(COUNTIF(INDIRECT("""&Sheets&""!N4:U6"),"R1-R24"))


Have you tried this and it didn't work?

Im confused, are you trying to count how many times R1-R24 and A1-A22 occurs?

or

R1, R2, R3...
A1, A2, A3...?
 
Last edited:
Upvote 0
Oh, it doesn't look like I explained that part very well. The codes are actually R1, R2, R3.... so with this one I'm actually looking for the total amount of R1 (or Peer1, since I don't think R1 would work).
 
Upvote 0
Good research! There's a typo in that formula (your version, not in Brian's original). It needs a single quote, not a double...

=SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheets&"'!N4:U6"),"R1"))

And the R1 being a valid address don't mean nuthin'. Works just fine looking for "A1" or "R1" for me.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,390
Members
452,909
Latest member
VickiS

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