Match data in two columns within date range

simonpp

New Member
Joined
Aug 27, 2009
Messages
2
I have a spreadsheet with a date column (A), debits (B) and credits (C). I’m trying to identify where an amount in the debit column appears in the credit column and the dates are within 5 days of each other. Any suggestions will be gratefully received!
Simon
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
how do you want them identified?

maybe in d2
somthing like

=if(sumproduct(--(abs(A$2:A$1000-a2)<=5),--(C$2:C$1000=B2))>1,"Yup","Nope")
copy and paste down
 
Upvote 0
its working absolutely fine, but its going top of my head. Could yu pls explain a bit as how its working.

Thanks for your help.

Paul
 
Upvote 0
its working absolutely fine, but its going top of my head. Could yu pls explain a bit as how its working.

Thanks for your help.

Paul
 
Upvote 0
Could somebody pls explain or give me any reference link, how the sumproduct is working here.

Thanks,
Paul
 
Upvote 0
Code:
=if(sumproduct(--(abs(A$2:A$1000-a2)<=5),--(C$2:C$1000=B2))>1,"Yup","Nope")

the use of the sumproduct in this situation counts logical true combinations

the logic formula (abs(A$2:A$1000-a2)<=5) is either true or false. the -- in front of it makes it be either numeric 1 or 0

the logic formula (C$2:C$1000=B2) is treated the same way.
any time a pair of cells in the same row both result in true, you will get a 1*1 or 1 if only one or neither are true the result will be 0


I do not know for sure whether you need the result to be greater than 0 or greater than 1, looking at it again it should probably be greater than 0 , and I do not remember my logic as to why I used greater than 1
 
Upvote 0

Forum statistics

Threads
1,214,861
Messages
6,121,971
Members
449,059
Latest member
oculus

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