Trying to make COUNTIFS, UNIQUE, and INDIRECT play nicely together

oenleunc

Board Regular
Joined
Aug 27, 2012
Messages
52
Office Version
  1. 2016
Platform
  1. Windows
Howdy,

I'm trying to (ultimately) create a visualization in Spotfire using a range full of dates (AF2:MX100), which Spotfire doesn't care for. That's fine, I just need to count the number of unique dates per row for given two-week period. That period would be the dates specified in E1:AE1 (26 columns denoting every other week).

Luckily I'm using Excel 365 so I can use the UNIQUE function (holy smokes does that make it easier). However, Excel is not appreciating my formula, and after an embarrassingly long time searching for something to help, I'm finally asking for help.

Excel Formula:
=COUNTIFS(UNIQUE(AF2:MX2,FALSE,FALSE))<INDIRECT(F1), (UNIQUE(AF2:MX2,FALSE,FALSE))>=INDIRECT(E1)

Where AF2:MX2 is the range of dates I'd like to count distinct values for, and I'd like the distinct values to be between dates E1 and F1.
 

Attachments

  • Excel Countifs.PNG
    Excel Countifs.PNG
    41.5 KB · Views: 11

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
It would help if you posted an example with the forum's tool named XL2BB, Please also show the expected result.

I had one quick thought.


Unique.xlsm
ABCDEF
11-Dec-2231-Dec-22
215-Nov-2212-Dec-2212-Dec-2215-Dec-2215-Dec-2230-Dec-22
3
43
8d
Cell Formulas
RangeFormula
B4B4=LET(x,UNIQUE(A2:F2,1,0),SUM((x>E1)*(x<F1)))
 
Upvote 0
Solution
Yup that works. I've never seen the "let" function before. I would love a quick explanation of the formula if you're willing.

I can't download XL2BB because work computer :(

Thank you!!
 
Upvote 0
I would love a quick explanation of the formula if you're willing.

try Excel's help for the Let function.
There are lots of good examples on this forum.

You can also try Excel Formulas Formula Evaluate
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,252
Members
449,075
Latest member
staticfluids

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