Countifs linking to another workbook, but with link to other workbook in another cell?

razorsharp192

New Member
Joined
Aug 24, 2022
Messages
4
Office Version
  1. 2010
hi all

I'm working on a spreadsheet that's using a countifs formula to count instances of 2 variables. The formula is looking at a seperate workbook and a specific sheet within that workbook. The workbook has seperate tabs for each month, my formula looks at figures on a monthly basis.

I've set up a version of my spreadsheet as a template (as this is for a monthly thing), but currently the formula has the full file path of the other workbook and sheet in it (e.g. AUG tab of workbook "figures"), however for use as a template this is no good, as when I need to set up September's figures my formulas will contain AUG.

What I could do with is having the file path of the other workbook in a different cell (e.g. cell A1) and then have my formula point to that cell rather than having the file path in the formula itself.

my current formula is

=COUNTIFS('C:\Desktop\EXCEL EXAMPLE\[DATA.xlsx]AUG'!$A$3:$A$9, A3, 'C:\Desktop\EXCEL EXAMPLE\[DATA.xlsx]AUG'!$B$3:$B$9, $B$1)

however I'd like to have the "C:\Desktop\EXCEL EXAMPLE\[DATA.xlsx]AUG" bit in a different cell, with the formula pointing to that cell.

is that possible?


(FYI i'm using Excel 2010)
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi & welcome to MrExcel.
How about
Excel Formula:
=COUNTIFS(INDIRECT("'"&a1&"'!$A$3:$A$9"), A3, INDIRECT("'"&A1&"'!$B$3:$B$9"), $B$1)
 
Upvote 0
Hi & welcome to MrExcel.
How about
Excel Formula:
=COUNTIFS(INDIRECT("'"&a1&"'!$A$3:$A$9"), A3, INDIRECT("'"&A1&"'!$B$3:$B$9"), $B$1)


Hi, thanks for getting back to me, i'm getting a REF! error when i input that formula, how exactly should I have the file path stated in cell A1?
 
Upvote 0
Is the other workbook open?
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,521
Messages
6,125,306
Members
449,218
Latest member
Excel Master

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