Formula to Count Unique Values in Column based on Date Ranges in Another

jonnycuest

New Member
Joined
Nov 6, 2017
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am looking to count unique values in 1 column with criteria that involves date ranges from TODAY()-30 and TODAY() in another column.

Unique Values in Column D:D
Date Ranges in Column V:V which need to fall between TODAY()-30 and TODAY

I can't figure out how to get both of these working together in one formula.

Thank you!
 

jonnycuest

New Member
Joined
Nov 6, 2017
Messages
22
Office Version
  1. 365
Platform
  1. Windows
I'm comparing it to the solution provided and I'm not seeing any brackets out of place. Can you advise?

=IFERROR(ROWS(UNIQUE(FILTER(A2:A10,(LEFT(B2:B10,10)+0>TODAY()-1)*(LEFT(B2:B10,10)+0<TODAY())))),0)
=IFERROR(ROWS(UNIQUE(FILTER('CF - MM Main'!D:D,(LEFT('CF - MM Main'!V:V,10)+0>TODAY()-1)*(LEFT('CF - MM Main'!V:V,10)+0<TODAY())))),0)

These have the brackets in the same place
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
65,728
Office Version
  1. 365
Platform
  1. Windows
These have the brackets in the same place
My eyesight must be playing tricks on me. You're quite right.

It maybe that either there are no dates that match the criteria, or the values in col V are not being recognised as dates after taking the 1st 10 characters.
 

jonnycuest

New Member
Joined
Nov 6, 2017
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Thanks,

So the values in that column are general text exported from another system. They look like this: 2021-07-13 12:19:04 UTC
The formula should be picking them up.

I am kind of stumped.

I've even split them into a column with just the date and it's still not counting correctly.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
65,728
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Ok, when I added the IfError, I obviously change the formula for some reason, it should be Today()-30 not -1
 

jonnycuest

New Member
Joined
Nov 6, 2017
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Oh that's not really the issue. I am using -1 and -30 and -365 in different iterations of this formula. I have checked the -1 and it should be adding up to 2. It is showing 0. Just FYI.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
65,728
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Well the -1 will always result in 0 as a date cannot be greater than 13 Jul AND less than 14 Jul
 

jonnycuest

New Member
Joined
Nov 6, 2017
Messages
22
Office Version
  1. 365
Platform
  1. Windows
oooooh, there it is. Is it possible to add > or = to this equation?
 

jonnycuest

New Member
Joined
Nov 6, 2017
Messages
22
Office Version
  1. 365
Platform
  1. Windows
oh nvm, I just did -2 and called it a day. thank you. sheesh. my bad for wasting so much time. I get it now.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
65,728
Office Version
  1. 365
Platform
  1. Windows
Glad it's sorted & thanks for the feedback.
 

Forum statistics

Threads
1,147,734
Messages
5,742,861
Members
423,760
Latest member
photogfrog

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
Top