Need to match site code and pick the furthest date out

rentonhighlands

Board Regular
Joined
Jul 31, 2014
Messages
132
Office Version
  1. 365
Platform
  1. Windows
Need to match site code and pick the furthest date out

code date
site code 1 1/27/2025
site code 1 2/15/2025
site code 2 3/1/2025
site code 2 3/25/2025
 
=IF(COUNTIF($B$2:B2,B2)=COUNTIF($B$2:$B$1000,B2),WORKDAY(MAXIFS($Y$2:$Y$1000,$Y$2:$Y$1000,Y2),60),"")
This is the formula I have in my data

Where col Y in my data is blank I want the formula to return a blank

what is happening is where excel only find 1 of the same code in col B then it returns 3/23/1900. In other words where it does not find 2 of the same then it returns 3/23/1900.
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
ok, so if no value in code column OR no value in the DATE column
=IF(OR(A3="",B3=""),"",IF(COUNTIF($A$3:A3,A3)=COUNTIF($A$3:$A$1000,A3),WORKDAY(MAXIFS($B$3:$B$1000,$A$3:$A$1000,A3),60),""))

you are using
=IF(COUNTIF($B$2:B2,B2)=COUNTIF($B$2:$B$1000,B2),WORKDAY(MAXIFS($Y$2:$Y$1000,$Y$2:$Y$1000,Y2),60),"")
SO the code is in column B and the date is in columnY

so this should work
=IF(OR(B2="",Y2=""),"", IF(COUNTIF($B$2:B2,B2)=COUNTIF($B$2:$B$1000,B2),WORKDAY(MAXIFS($Y$2:$Y$1000,$Y$2:$Y$1000,Y2),60),""))


Book2
ABCDEFGHIJKLMNYZ
1codedate60 business days
2site code 11/27/25 
3 
4site code 111/15/25 
5site code 13/1/25 
6site code 14/1/25 
7site code 23/1/255/23/25
8site code 123/25/256/17/25
9Site code 311/1/25 
10Site code 34/25/251/23/26
11site code 45/1/25 
12site code 45/25/258/15/25
13site code 53/1/255/23/25
14site code 63/15/256/6/25
15site code 73/16/256/6/25
16site code 83/17/256/9/25
17site code 93/18/256/10/25
18site code 103/19/256/11/25
19 
20codedate3/23/00
21site code 11/27/25 
22site code 111/15/252/6/26
23site code 2003/1/255/23/25
24site code 201 
25site code 202 
26site code 203 
27site code 204 
28site code 205 
29site code 206 
30site code 207 
31site code 208 
32site code 209 
33site code 210 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
Sheet1
Cell Formulas
RangeFormula
Z2:Z43Z2=IF(OR(B2="",Y2=""),"",IF(COUNTIF($B$2:B2,B2)=COUNTIF($B$2:$B$1000,B2),WORKDAY(MAXIFS($Y$2:$Y$1000,$B$2:$B$1000,B2),60),""))
 
Upvote 0
=IF(OR(B2="",Y2=""),"", IF(COUNTIF($B$2:B2,B2)=COUNTIF($B$2:$B$1000,B2),WORKDAY(MAXIFS($Y$2:$Y$1000,$Y$2:$Y$1000,Y2),60),""))
yes this does work however it does not capture all. There are dates in col Y and the formula is not seeing them or could there be a formatting issue
 
Upvote 0
=IF(OR(B2="",Y2=""),"", IF(COUNTIF($B$2:B2,B2)=COUNTIF($B$2:$B$1000,B2),WORKDAY(MAXIFS($Y$2:$Y$1000,$Y$2:$Y$1000,Y2),60),""))
yes this does work however it does not capture all. There are dates in col Y and the formula is not seeing them or could there be a formatting issue
Hang on maybe it is working validating. Will update the thread tomorrow. Thank you
 
Upvote 0
you may need to change the range , if its more than a 1000 rows you are referencing
 
Upvote 0
=IF(OR(B2="",Y2=""),"", IF(COUNTIF($B$2:B2,B2)=COUNTIF($B$2:$B$1000,B2),WORKDAY(MAXIFS($Y$2:$Y$1000,$Y$2:$Y$1000,Y2),60),""))
This is working sorta
How can I alter this formula to do this
Look down column A match site code, look at col e find "private", look at col F find the latest date and return 60 work days from latest date

Site Code ASite Name ASite Address ASite City ATypeCarrier Estimated Delivery DateEstimated Disconnect Date
site code 1Broadband
site code 1Private5/31/2025
site code 1Internet5/31/2025
site code 1Private5/31/2025
site code 1Internet5/31/20258/22/2025
 
Upvote 0
its now in column A ??? rather than B
Col E - look for private is that Site Name A
and then col F

confused with your layout and question - see my post 12 , using Y for date , hence the formula references

can you post an XL2BB - so the data is correctly formatted
OR
share a file

also provide expected results ? would help

i suspect a countifs may work
 
Upvote 0
its now in column A ??? rather than B
Col E - look for private is that Site Name A
and then col F

confused with your layout and question - see my post 12 , using Y for date , hence the formula references

can you post an XL2BB - so the data is correctly formatted
OR
share a file

also provide expected results ? would help

i suspect a countifs may work
 
Upvote 0
I can't download xls2bb or upload a file. How do I upload a file?

1738175169852.png
 
Last edited:
Upvote 0
places like dropbox , onedrive , you can then share the file and post the link here
or googlesheets , and again share for everyone and then post the link here

just a guess
=IF(OR(A2="",Y2=""),"", IF(COUNTIFS($A$2:A2,A2,$E$2:E2,"private" )=COUNTIF($A$2:$A$1000,A2 , $E$2:$E$1000,"private" ),WORKDAY(MAXIFS($Y$2:$Y$1000,$Y$2:$Y$1000,Y2),60),""))
 
Upvote 0

Forum statistics

Threads
1,226,013
Messages
6,188,421
Members
453,473
Latest member
bbugs73

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