VBA SUMPRODUCT - Date overlap when ID number is the same

th259

New Member
Joined
Oct 24, 2023
Messages
35
Office Version
  1. 365
Platform
  1. Windows
I am trying to find if same id numbers has an overlap in dates and I got the following. Can you please tell me where I went wrong?

With ws
Dim LR As Long, _
DateFrom As Range, _
DateThru As Range, _
EIN As Range
LR = Range("A" & Rows.Count).End(xlUp).Row
Set DateFrom = Range("J2:K" & LR)
Set DateThru = Range("K2:J" & LR)
Set EIN = Range("B2:B" & LR)
Range("L2").Forumla = "=SUMPRODUCT((RC[-2]<=" & DateThru.Address & ")*(RC[-1]>=" & DateFrom.Address & ")*(RC[-11]=" & EIN.Address & "))>1"
End With
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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