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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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,215,429
Messages
6,124,835
Members
449,192
Latest member
mcgeeaudrey

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