Use only the date in a column for array formula

honkin

Active Member
Joined
Mar 20, 2012
Messages
385
Office Version
  1. 2016
Platform
  1. MacOS
I have a sheet which records football results and it uses an array formula to identify the number of unique days in the date column. Not every day has a match, so even though the year might have 365 days, there may only be 250 days with matches, so the formula determines the number of unique days.

The main aim of that is to be able to accurately determine how many selections are being generated per day, so I need to know how many days there are which actually have matches

Here is the array formula I use and it works fine when column C is date only.

{=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(C17:C1048576,ROW(C17:C1048576)-ROW(C17),0,1)),C17:C1048576),C17:C1048576),1))}

The data starts from row 17 and unfortunately this sheet has column C as a combination of date and time. Unlike a horse racing sheet which I have, this one has the date and time in the same cell and it is not possible to separate them or add a helper column.

The issue with this at the moment is it is using the time to determine when the date is unique and I need it to only use the date part of column C.

Here is a sample of data and as you can see, the dates showing are 22, 23, 24 & 26 of May 2020, yet the array formula shows the number of unique days in the double digits due to the different times

Predictology AI Export Apr with Reporting.xlsb
BCD
390Belarus: Vysshaya Liga22/05/2020 17:00Shakhtyor - Belshina
391Ger. Bundesliga I22/05/2020 18:30Hertha - Union Berlin
392Korea: K-League Classic23/05/2020 07:30Gangwon - Seongnam
393Korea: K-League Classic23/05/2020 07:30Suwon Bluewings - Incheon United
394Korea: K-League Classic23/05/2020 10:00Sangju Sangmu - Gwangju
395Ger. Bundesliga II23/05/2020 11:00Darmstadt 98 - St Pauli
396Ger. Bundesliga II23/05/2020 11:00Osnabrück - Hannover
397Ger. Bundesliga II23/05/2020 11:00Sandhausen - Regensburg
398Ger. Bundesliga I23/05/2020 13:30Freiburg - Werder Bremen
399Ger. Bundesliga I23/05/2020 13:30M'Gladbach - Leverkusen
400Ger. Bundesliga I23/05/2020 13:30Paderborn - Hoffenheim
401Belarus: Vysshaya Liga23/05/2020 13:30Slutsk - Ruh Brest
402Ger. Bundesliga I23/05/2020 13:30Wolfsburg - Dortmund
403Hungary: NB I23/05/2020 13:55Ferencváros - Debrecen
404Belarus: Vysshaya Liga23/05/2020 15:30Isloch - Ynergetyk-BDU
405Ger. Bundesliga I23/05/2020 16:30Bayern Munich - Ein Frankfurt
406Belarus: Vysshaya Liga23/05/2020 17:30Vitebsk - Dinamo Minsk
407Korea: K-League Classic24/05/2020 07:30Jeonbuk Motors - Daegu
408Korea: K-League Classic24/05/2020 10:00Ulsan - Busan I'Park
409Ger. Bundesliga II24/05/2020 11:30Hamburg - Bielefeld
410Ger. Bundesliga II24/05/2020 11:30Holstein Kiel - Stuttgart
411Ger. Bundesliga II24/05/2020 11:30Karlsruhe - Bochum
412Ger. Bundesliga I24/05/2020 11:30Schalke 04 - Augsburg
413Ger. Bundesliga I24/05/2020 13:30Mainz - RB Leipzig
414Ger. Bundesliga I24/05/2020 16:00FC Koln - Dusseldorf
415Ger. Bundesliga I26/05/2020 16:30Dortmund - Bayern Munich
rc-vdw-place-adapted-2021-01-01


Is this achievable at all, or will I have to look for another way?

Thanks in advance
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
To get only the dates wrap the last two instances of C17:C1048576 in your formula with INT
INT(C17:C1048576)

M.
 
Upvote 0
Solution
@Marcelo Branco. I don't have access to pre-365 version of Excel anymore but for some formulas you can replace the SUM with SUMPRODUCT and it saves having to use CSE (Control+Shift+Enter).
Would love to know if it works for this one.
 
Upvote 0
@Marcelo Branco. I don't have access to pre-365 version of Excel anymore but for some formulas you can replace the SUM with SUMPRODUCT and it saves having to use CSE (Control+Shift+Enter).
Would love to know if it works for this one.

Hi Alex.

In some cases, using pre-365 versions, is possible to replace formulas that require CSE by SUMPRODUCT confirmed with just Enter.

In this specific case, honkin's formula, such is not possible because there is an IF inside SUMPRODUCT for, i suppose, to count unique dates after applying filter with some criteria. IFs dealing with arrays always require CSE.

Would be possible to build a different formula to count unique dates using SUMPRODUCT confirmed with just ENTER. A kind of structure like (example with a smaller range C17:C100):
=SUMPRODUCT(--SUBTOTAL(3,OFFSET(C17:C100,ROW(C17:C100)-ROW(C17),0,1)), --(MATCH(C17:C100,C17:C100,0)=ROW(C17:C100)-ROW(C17)+1))

But... using INT to get the dates the formula above would require CSE

Greetings

M;
 
Last edited:
Upvote 0
Hi Alex.

In some cases, using pre-365 versions, is possible to replace formulas that require CSE by SUMPRODUCT confirmed with just Enter.

In this specific case, honkin's formula, such is not possible because there is an IF inside SUMPRODUCT for, i suppose, to count unique dates after applying filter with some criteria. IFs dealing with arrays always require CSE.

Would be possible to build a different formula to count unique dates using SUMPRODUCT confirmed with just ENTER. A kind of structure like (example with a smaller range C17:C100):
=SUMPRODUCT(--SUBTOTAL(3,OFFSET(C17:C100,ROW(C17:C100)-ROW(C17),0,1)), --(MATCH(C17:C100,C17:C100,0)=ROW(C17:C100)-ROW(C17)+1))

But... using INT to get the dates the formula above would require CSE

Greetings

M;
Thanks Marcello, I swapped in the SUM for SUMPRODUCT in 365 and it worked but I was not convinced that was a reliable indication that it would work in pre-365 versions.
Thank you for confirming that I can't really test it in 365 and need to be careful about offering pre-365 solutions, appreciate you spending the time on it.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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