Indirect

Cooki

Board Regular
Joined
Jul 31, 2018
Messages
86
Hi All im getting #Ref for this formula, but i cant see the issue with it

=IF(COUNTIF(INDIRECT("'["&$F$1&"]"&$E$1&"'!"),A2),"Match","No Match")

F1 is the workbook name
E1 is the tab name

When im evaluating it, its saying "'["&$F$1&"]"&$E$1&"'!" is the issue

Can someone spot where ive gone wrong?

Thanks
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Let's write out what your formula would look like if F1 = "Book1.xlsx" and E1 - "Data"
Excel Formula:
=IF(COUNTIF([Book1.xlsx]Data!, A2), "Match", "No Match")

Now let's look at the syntax for CountIF
VBA Code:
COUNTIF(RangeArray, CiteriaRange)

Looks like you are missing the RangeArray between the apostrophe '!' and comma ','. You have the workbook and sheet but no range/
 
Upvote 0
you haven't selecte a range: this works:
=IF(COUNTIF(INDIRECT("'["&$F$1&"]"&$E$1&"'!A1:a10"),A2),"Match","No Match")
 
Upvote 0
Dam..... so close, just overlooked the range.

Much appreciated both, works fine now
 
Upvote 0

Forum statistics

Threads
1,223,882
Messages
6,175,165
Members
452,615
Latest member
bogeys2birdies

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