Match Unique vs Duplicate Dates

tiger_78

New Member
Joined
Oct 16, 2020
Messages
14
Office Version
  1. 365
  2. 2013
  3. 2007
Platform
  1. Windows
Hi, I need a solution to this...
I am comparing Sheet 1 Unique Dates, with Sheet 2 Duplicate Dates - both for the same Client.

My aim is to test with a 'True' or 'False' flag 'field I want', if a date matches or not - for each Client:

If any Date within a Client matches, Flag with TRUE
(the remaining Dates for that Client just leave Blank)

If any Date within a Client does not match, Flag with FALSE
Thanks!

Sheet 1
Unique Client No.Operation Date
24677720/07/2020
24705121/07/2020
24709925/07/2020
24717401/07/2020
24965014/08/2020

Sheet 2
Duplicate Client No.Operation Datefield I want
24677720/07/2020TRUE
24705121/06/2020
24705121/07/2020TRUE
24709925/07/2020TRUE
24717401/05/2020
24717401/06/2020
24717401/07/2020TRUE
24965015/05/2020FALSE
24965015/06/2020FALSE
24965010/06/2020FALSE
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
1,830
Office Version
  1. 365
Platform
  1. Windows
Please try this
=COUNTIFS(Sheet1!$A$2:$A$6,Sheet2!A2,Sheet1!$B$2:$B$6,Sheet2!B2)>0
 

tiger_78

New Member
Joined
Oct 16, 2020
Messages
14
Office Version
  1. 365
  2. 2013
  3. 2007
Platform
  1. Windows
Please try this
=COUNTIFS(Sheet1!$A$2:$A$6,Sheet2!A2,Sheet1!$B$2:$B$6,Sheet2!B2)>0
Works mostly! But I would like the Blank values as above:
(the remaining Unmatching Dates for that Client - just leave Blank)
 

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
1,830
Office Version
  1. 365
Platform
  1. Windows
Why do the last 3 rows have false values for a client on the list but now matching date?
 

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
1,830
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

=IF(COUNTIFS(Sheet1!$A$2:$A$6,Sheet2!A12,Sheet1!$B$2:$B$6,Sheet2!B12)>0,TRUE,IF(COUNTIFS(Sheet1!$A$2:$A$6,Sheet2!A12)>0,"",FALSE))
The above formula shows if match client number and matching date, or blank if matching client number and no matching date, or FALSE if no matching client number
 

tiger_78

New Member
Joined
Oct 16, 2020
Messages
14
Office Version
  1. 365
  2. 2013
  3. 2007
Platform
  1. Windows
Why do the last 3 rows have false values for a client on the list but now matching date?
Thanks.
Because none of the 3 Sheet 2 dates (15/05/2020, 15/06/2020, 10/06/2020) match the Sheet 1 date (14/08/2020) for that Client (249650).
This scenario can happen in my real data...that's why I included it.
 

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
1,830
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Thanks.
Because none of the 3 Sheet 2 dates (15/05/2020, 15/06/2020, 10/06/2020) match the Sheet 1 date (14/08/2020) for that Client (249650).
This scenario can happen in my real data...that's why I included it.
Then for line 2 you have a similar condition. A matching client but no matching date.
 

tiger_78

New Member
Joined
Oct 16, 2020
Messages
14
Office Version
  1. 365
  2. 2013
  3. 2007
Platform
  1. Windows
Then for line 2 you have a similar condition. A matching client but no matching date.
Line 2 (247051) has a matching date (21/07/2020) so I will flag that as TRUE, the other date (21/06/2020) for him I want to leave Blank.
 

tiger_78

New Member
Joined
Oct 16, 2020
Messages
14
Office Version
  1. 365
  2. 2013
  3. 2007
Platform
  1. Windows
=IF(COUNTIFS(Sheet1!$A$2:$A$6,Sheet2!A12,Sheet1!$B$2:$B$6,Sheet2!B12)>0,TRUE,IF(COUNTIFS(Sheet1!$A$2:$A$6,Sheet2!A12)>0,"",FALSE))
The above formula shows if match client number and matching date, or blank if matching client number and no matching date, or FALSE if no matching client number
All I get here are all FALSE
 

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
1,830
Office Version
  1. 365
Platform
  1. Windows
I duplicated your data and this is my results

Book1
ABC
1Duplicate Client No.Operation Datefield I want
224677720/07/2020TRUE
324705121/06/2020 
424705121/07/2020TRUE
524709925/07/2020TRUE
62471741/5/2020 
72471741/6/2020 
82471741/7/2020TRUE
924965015/05/2020 
1024965015/06/2020 
1124965010/6/2020 
1211144410/1/2020FALSE
Sheet2
Cell Formulas
RangeFormula
C2:C12C2=IF(COUNTIFS(Sheet1!$A$2:$A$6,Sheet2!A2,Sheet1!$B$2:$B$6,Sheet2!B2)>0,TRUE,IF(COUNTIFS(Sheet1!$A$2:$A$6,Sheet2!A2)>0,"",FALSE))
 

Watch MrExcel Video

Forum statistics

Threads
1,123,343
Messages
5,601,073
Members
414,426
Latest member
fraru

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