Record items appearing in 2 adjacent columns over a given period

Onebracketshort

New Member
Joined
Dec 19, 2019
Messages
37
Office Version
  1. 2010
Platform
  1. Windows
For each row I would like to see if the value in column B appears in either column B or column C at any time over the previous 3 days. If the value appears in the previous 3 days I would like to record the number of the current row in column D.

I would also like to see, for the a each row, if the value in column C appears in either column B or column C at any time over the previous 3 days. If the value appears in the previous 3 days I would like to record the number of the current row in column E.

I have this formula from a previous post

=IF(COUNTIFS(A:A,">="&A10-3,A:A,"<"&A10,C:C,C10),ROW(),"")

I think I need to tweak it to include the additional B column range but excel errors requiring me to provide an additional arguement.

Errors on this formula =IF(COUNTIFS(A:A,">="&A10-3,A:A,"<"&A10,B:B,C:C,C10),ROW(),"")

Any ideas as to where I'm going wrong? Many thanks


Book1
ABCDE
1DateItem 1 Item 2Item 1 or Item 2 appears in last 3 daysItem 1 or Item 2 appears in last 3 days
201/01/2020ApplePear
302/01/2020OrangeGrape
403/01/2020PineappleBannana
504/01/2020RasberryBlackberry
605/01/2020BlueberrySatsuma
706/01/2020ApplePear
807/01/2020MangoOrange
908/01/2020MelonGrape
1009/01/2020PineappleBannana
1110/01/2020MangoMelon
Sheet1
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
If you want to do an OR on the items, add them, like IF((COUNTIFS(etc ... item1)+COUNTIFS(etc ... item2))>0,ROW(),"")
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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