advance filter with or and and fuction

zakizelani

New Member
Joined
Mar 3, 2016
Messages
25
hi,

I will like to do an advanced filter so that I can spot duplicate.First, let me go through my sheet first.

I creating a shet for the user to make a booking for their the slot.


1. First user input the start time of the appointment at V3


2. the total hours of the booking at V5 (0.5,1,1.5,2,2.5 Every 30 mins)

3. next they need to book the slot at AY3:BF7


AY:BB BC:BF
Slot 11130SL1
Slot 21200SL2
Slot 3
Slot 4
Slot 5

<tbody>
</tbody>


for example, the user wants to book at 1130 for 1hr

slot 1 will populate the data validation list of (1130sl1,1130sl2,1130sl3.....1130sl5)

while slot 2 will be 1200sl1,.....1200sl5)


when they click the add booking button, my code will go through and filter to see if there is any duplicate.



Criteria
Slot 1Slot 2Slot 3Slot 4Slot 5Appt DateStore
=1130SL1 = = = = >=43131=Kembangan
= = = = = <=43131=Kembangan

<colgroup><col span="5"><col><col></colgroup><tbody>
</tbody>



Range("B8:Z15").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"BI6:BP8"), CopyToRange:=Range("BQ8:BX8"), Unique:=False


However the outcome is not what i want because if the user book at 1130 in slot 2 it will never filter it out as the creteria is under slot 1. what i need is to prevent user to book the same slot on the timing in the same day.



user A : book 1130sl1 in slot 1 on 1/1/21

user B : book 1130sl1 in slot 2 on 1 /1/21

i need them to capture that this is duplicate


user A : book 1130sl1 in slot 1 on 1/1/21

user B : book 1130sl1 in slot 2 on 2 /1/21

this is not duplicate

hope you understand what i want to say here
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,214,792
Messages
6,121,612
Members
449,038
Latest member
apwr

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