3D Referencing

Tikey

Board Regular
Joined
Jan 30, 2014
Messages
148
Office Version
  1. 2021
Platform
  1. Windows
I am using Office Pro 2021

I have what I guess is a fairly straight forward formula to count the number of unique dates in a range, for a particular month, in this example for August. The range of cells do not necessarily always all contain values.

=COUNT(UNIQUE($E$16:$E$20000/(MONTH($E$16:$E$20000)=8)))

That works fine, but I wish to use 3D referencing and apply this across a number of sheets

=COUNT(UNIQUE('AB1:AB5'!$E$16:$E$20000/(MONTH('AB1:AB5'!$E$16:$E$20000)=8)))

Now it just returns 0. I’m sure I have used the correct sheet range name notation ( 'AB1:AB5'! ) and have tried searching for an answer without success.

Can anyone offer a solution.

Thank you
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
In that case you won't be able to use Domenic's idea, as it cannot handle that many cells. I think you will have to do each sheet separately.
Hi Fluff,

Thanks for pointing that out. I really appreciate it.

Cheers!
 
Upvote 0
Here's a possible alternative. Note, though, it uses the volatile functions OFFSET and INDIRECT. Also, you'll find it somewhat inefficient. Anyway, first list your sheet names in a vertical range of cells, let's say A2:A6. Then try the following formula . . .

Excel Formula:
=LET(shts,$A$2:$A$6,arr,N(OFFSET(INDIRECT("'"&INDEX(shts,INT(SEQUENCE(ROWS(shts)*20000,,0,1)/20000)+1)&"'!E16:E20000"),MOD(SEQUENCE(ROWS(shts)*20000,,0,1),20000),0,1)),COUNT(UNIQUE(FILTER(arr,MONTH(arr)=8))))

However, for the month of January, you'll need to use the following formula instead, in case you have empty/blank cells in your ranges . . .

Excel Formula:
=LET(shts,$A$2:$A$6,arr,N(OFFSET(INDIRECT("'"&INDEX(shts,INT(SEQUENCE(ROWS(shts)*20000,,0,1)/20000)+1)&"'!E16:E20000"),MOD(SEQUENCE(ROWS(shts)*20000,,0,1),20000),0,1)),COUNT(UNIQUE(FILTER(arr,(arr>0)*(MONTH(arr)=1)))))

Hope this helps!
 
Last edited:
Upvote 0
Solution
They both work, thank you. The inefficiency I suppose is shown in the time delay for the sheet to update when any change is made.

I have been editing some other formulas I use and have found that:

=SUMPRODUCT(--(FREQUENCY('AB1:AB5'!E16:E20000,'AB1:AB5'!E16:E20000)>0))

works, but in this form sums dates for the year. I have tried introducing (MONTH($E$16:$E$20000)=8) into the formula to obtain a monthly value without success, but I guess I'm doing something wrong.
 
Upvote 0
They both work, thank you.
You're very welcome!
The inefficiency I suppose is shown in the time delay for the sheet to update when any change is made.
Yes, that's right. The time delay can be very frustrating. For this reason, you may want to seek out an alternative solution instead.
I have been editing some other formulas I use and have found that:

=SUMPRODUCT(--(FREQUENCY('AB1:AB5'!E16:E20000,'AB1:AB5'!E16:E20000)>0))

works, but in this form sums dates for the year. I have tried introducing (MONTH($E$16:$E$20000)=8) into the formula to obtain a monthly value without success, but I guess I'm doing something wrong.
Initially, I did look into the use of FREQUENCY for a solution. However, like you, discovered that it won't accept such a construct with a 3D reference. But if you combine all of your data into one worksheet, you'll be able to use it that way. Otherwise, you may want to seek out a VBA solution instead.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,454
Members
449,083
Latest member
Ava19

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