Countif formula that references a range based on the value of a separate cell

maclachlan19

Board Regular
Joined
Jul 8, 2013
Messages
53
Sorry, I couldn't figure out a better way to present this.
I have a named Range in my spreadsheet.
I want to use a Countif formula. But I want the name of the range to be referenced from another cell.
I can't figure out how to write the formula.
In example 2 below, the cell E8 contains Range1



Example 1
Named RangeThis formula works
3023033021Formula is =COUNTIF(Range1,D5)
455654Example 2
480409I would like this formula to work
110995302Range10Formula is =COUNTIF(E8,D8)
781861(I have referenced E8 in the formula but it doesn't work)
235582
185991

<colgroup><col span="6"><col><col span="6"></colgroup><tbody>
</tbody>

<colgroup><col span="6"><col><col span="6"></colgroup><tbody>
</tbody>
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try it this way...

=COUNTIF(INDIRECT(E8),D8)

Cell E8 contains a text string so you need to use the INDIRECT formula to get Excel to convert it to a range reference.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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