Forum

Notifications
Clear all

Search and mark

11 Posts
5 Users
0 Reactions
72 Views
 H R
(@horizon306)
Posts: 5
Active Member
Topic starter
 

I need a macro to be able to search and mark in several records since with a formula the expected result is not obtained. I need you to look for the reference number, if that reference is on two or several different dates, you must put the number 2, if a number 1 is one or more times with the same date. Attached example.

 
Posted : 26/02/2020 7:37 pm
(@purfleet)
Posts: 412
Reputable Member
 

To clarify?

if the reference only appears once = Nothing
if the reference appears twice on the same date  = 1
if the reference appears twice on different dates = 2

Would the number show on both rows or just the first?

Purfleet

 
Posted : 27/02/2020 2:52 am
(@debaser)
Posts: 837
Member Moderator
 

Since your data appears to be sorted on column A, perhaps this formula in C3:

 

=IF(OR(A3=A2,A3<>A4),"",IF(COUNTIFS($A4:$A$4914,A3,$B4:$B$4914,"<>"&B3)>0,2,1))

 

then fill it down.

 
Posted : 27/02/2020 8:01 am
 H R
(@horizon306)
Posts: 5
Active Member
Topic starter
 

Purfleet Thank you for the answer, if it is duplicated on the same date a number 1 will appear, if it is duplicated on different dates a number 2 will appear. The number will be shown only in the first row

 
Posted : 28/02/2020 8:39 am
 H R
(@horizon306)
Posts: 5
Active Member
Topic starter
 

Velouria Thank you for the answer, I have put the formula, but some do not put the number 1, I do not know if I am doing something wrong. I have marked as an example in the attached some cells that appear blank. Thank you.

 
Posted : 28/02/2020 8:44 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi HR,

There's no attachment in your last post.

Regards

Phil

 
Posted : 28/02/2020 10:13 pm
 H R
(@horizon306)
Posts: 5
Active Member
Topic starter
 
Sorry, I thought it was attached. I attach it again. Thank you
 
Posted : 02/03/2020 10:20 am
(@sunnykow)
Posts: 1417
Noble Member
 

Give this a try.

In C2 enter

=IF(COUNTIFS($A$3:$A$4914,A3)>=2,2,1)-COUNTIFS($A$3:$A$4914,A3,$B$3:$B$4914,B3)+1

Sunny

 
Posted : 02/03/2020 8:07 pm
(@debaser)
Posts: 837
Member Moderator
 

Can you clarify what is missing in that example and why?

 
Posted : 03/03/2020 4:37 am
 H R
(@horizon306)
Posts: 5
Active Member
Topic starter
 
Thanks for the answer SunnyKow, it works.
 
Velouria In the example attached in cell C is the formula I had been given: =IF(OR(A3=A2,A3<>A4),"",IF(COUNTIFS($A4:$A$4914,A3,$B4:$B$4914,"<>"&B3)>0,2,1)) but that by putting it some cells are empty, I don't know the reason or if I do something wrong.
 
Thank you.
 
Posted : 03/03/2020 7:09 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi H R

Thanks for your feedback.

Happy to know it is working.

Cheers

Sunny

 
Posted : 03/03/2020 11:55 pm
Share: