Formula to Extract Address Based on Today's Date

Justinian

Well-known Member
Joined
Aug 9, 2009
Messages
1,557
Office Version
  1. 365
Platform
  1. Windows
I am trying to use the FILTER function on a sample data set below and I need to extract just the address in column A based on dates in columns J through AF. The problem is that the date could appear in any column J through AF and it appears in a cell that looks like this: "Scheduled: 07/06/23" so if I use =IFERROR(MID(B2,FIND("/",B2)-2,8),0) to extract just the date, the FILTER function will not recognize the result of 07/06/23.

Here is a sample:
Book1.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1AddressFloorplan codeFloorplan nameUnit statusMove out dateMove in dateComplete by dateDate made readyRequests done1st InspPestStripUpgrade StartUpgrade FinishCounter topsInstall ACMechKitchen FloorApplianceDishwasherPaintCleanHardwood FloorShampooCarpetTub ReglazeFirst WalkCorrectionsFinal CorrectionsFinal PTUPLB FinalRekey exterior door locks
209-091921 G 2 KU021 Garden 2Bd Kit UpgdVacant Leased 6/13/202208/01/23 07/31/23 22Completed: 06/14/22 Completed: 07/27/22 Scheduled: 06/14/22 TREAT VACANT UNIT - DUST OUTLETS Completed: 06/14/22 Completed: 06/14/22 Completed: 06/14/22 Completed: 06/14/22 Completed: 06/14/22 C/AIR Completed: 06/21/22 Scheduled: 06/20/22 LEVEL 1 comp by a/m 06/20/22 Completed: 06/14/22 Completed: 06/14/22 Completed: 06/14/22 Completed: 06/28/22 Scheduled: 06/21/22 G2 - KIT UPGRADE - FULL PAINT Completed: 06/27/22 Scheduled: 06/27/22 Complete 06/27 TA Completed: 06/27/22 Scheduled: 06/24/22 Complete 06/24 Santos Completed: 06/14/22 Completed: 07/07/22 Scheduled: 06/23/22 HW/HW - STAIRS Completed: 06/14/22 Completed: 06/28/22 Scheduled: 06/27/22 Complete 06/28 HB Completed: 07/01/22 Scheduled: 06/28/22 comp by carmelo 06/30/22 Completed: 07/01/22 comp by carmelo 06/30/22 Completed: 07/27/22 6/29: NB Walked - Corrections given to OC. 11.04 down for mortar repair Completed: 07/27/22
310-105517 G 1U KU017 Garden 1Bd Upper Kit UpgdVacant Not Leased 6/24/202307/08/23 8Completed: 06/26/23 Scheduled: 06/26/23 TREAT VACANT UNIT - DUST OUTLETS Completed: 06/26/23 Completed: 06/26/23 Completed: 06/26/23 R/R KITCHEN COUNTER (FORMICA) Completed: 06/26/23 1 AC Scheduled: 06/30/23 level 1 Completed: 06/26/23 R/R STOVE, FRDIGE (STAINLESS STEEL) R/R DISHWASHER (STAINLESS STEEL) Scheduled: 07/03/23 Scheduled: 07/06/23 Scheduled: 07/07/23 Completed: 06/26/23 COMPLETE NO ENTRY Completed: 06/26/23
411-112014 G 1LKU014 Garden 1Bd Lower Kit UpgdVacant Not Leased 12/18/202107/31/23 2Completed: 04/03/23 FIRE UNIT - DNR TREAT VACANT UNIT - DUST OUTLETS Completed: 04/03/23 Build out unit '07/29/23 '07/29/23 '07/29/23 '07/29/23
512-121717 G 1U KU017 Garden 1Bd Upper Kit UpgdVacant Leased 6/23/202307/15/23 07/07/23 7Completed: 06/26/23 Scheduled: 06/26/23 TREAT VACANT UNIT - DUST OUTLETS Completed: 06/26/23 Completed: 06/26/23 Completed: 06/26/23 CUTOUT COUNTERTOP FOR STOVE INSTALL Completed: 06/26/23 1 AC Scheduled: 06/29/23 LEVEL 1 - R/R COOKTOP & BUILDBOUT CABINETS Completed: 06/26/23 R/R STOVE, FRIDGE, MICROWAVE (WHITE) R/R DISHWASHER (WHITE) Scheduled: 07/03/23 G1 - UPGRADE - FULL PAINT ***CARPET WILL BE REPLACED*** Scheduled: 07/06/23 Scheduled: 07/07/23 Completed: 06/26/23 COMPLETE NO ENTRY REGLAZE TUB Scheduled: 07/06/23 Scheduled: 07/07/23
612-125314 G 1LKU014 Garden 1Bd Lower Kit UpgdVacant Leased 6/21/202307/08/23 07/05/23 10Completed: 06/22/23 Scheduled: 06/22/23 TREAT VACANT UNIT - DUST OUTLETS Completed: 06/22/23 Completed: 06/22/23 Completed: 06/22/23 Completed: 06/22/23 Completed: 06/22/23 0/AC Scheduled: 06/29/23 R/R KITCHEN FLOOR R/R WHITE REFRIGERATOR Completed: 06/22/23 Completed: 06/28/23 Scheduled: 06/28/23 Scheduled: 07/03/23 Scheduled: 06/30/23 Completed: 06/22/23 Completed: 06/22/23 HW/HW Scheduled: 07/03/23 Scheduled: 07/04/23
714-143819 G 2B019 Garden 2BdVacant Not Leased 10/31/202207/31/23 19Completed: 11/01/22 Scheduled: 11/01/22 TREAT VACANT UNIT - DUST OUTLETS Completed: 11/01/22 Completed: 11/01/22 Completed: 11/01/22 Completed: 11/01/22 Completed: 11/01/22 C/AIR Completed: 11/04/22 Scheduled: 11/03/22 Complete 11/3 R/J LEVEL 1 Completed: 11/01/22 Completed: 11/09/22 '11/08/22 R/R - REFRIGERATOR (WHITE) Completed: 11/09/22 '11/08/22 R/R - DISHWASHER (WHITE) Completed: 11/07/22 Scheduled: 11/07/22 G2 - CLASSIC - FULL PAINT ***CARPET WILL BE REPLACED*** Completed: 11/11/22 Scheduled: 11/10/22 COMP BY TEAM A 11/10/22 Completed: 11/10/22 Scheduled: 11/09/22 comp by santo 11/09/22 Completed: 11/01/22 Completed: 11/09/22 Scheduled: 11/07/22 STAIRS ONLY Completed: 11/01/22 Completed: 11/15/22 Scheduled: 11/16/22 comp gy sam 11/15/22 Completed: 11/16/22 Scheduled: 11/16/22 comp by arturo 11/15/22 Completed: 12/06/22 12/5: NB walked - Corrections given to ABM & Painters.
815-151420 G 2 Upg020 Garden 2Bd UpgradeVacant Leased 6/29/202308/02/23 07/13/23 0Scheduled: 07/03/23 Scheduled: 07/05/23 '07/15/23 Scheduled: 07/07/23
Sheet2
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
(MID(B2,FIND("/",B2)-2,8),0)
The MID function returns a text, so if you are going to compare it against a date, then you must convert that text to a date and thus perform the comparison.

------
Completed: 07/27/22 Scheduled: 06/14/22 TREAT VACANT UNIT - DUST OUTLETS
But I have a question, because you have texts with 2 dates, so if you search with Find it will extract the first one and I don't know if it is the correct one.

-----

How about:
If you are going to search for that date, in the cells you have texts, one option is to search for the date as text:


Excel Formula:
=IFERROR(FILTER(A2:A8,BYROW(J2:AF8,LAMBDA(br,SUM(--ISNUMBER(SEARCH("07/06/23",br)))))),"Not Exists")

;)
 
Upvote 0
The MID function returns a text, so if you are going to compare it against a date, then you must convert that text to a date and thus perform the comparison.

------

But I have a question, because you have texts with 2 dates, so if you search with Find it will extract the first one and I don't know if it is the correct one.

-----

How about:

If you are going to search for that date, in the cells you have texts, one option is to search for the date as text:


Excel Formula:
=IFERROR(FILTER(A2:A8,BYROW(J2:AF8,LAMBDA(br,SUM(--ISNUMBER(SEARCH("07/06/23",br)))))),"Not Exists")

;)
Thank you for your reply.

I am just looking to extract the first date if there are cells where more than one date appears.

The idea is to use FILTER so I can display any addresses that have only today's date in any of the rows. The plan here is for my team to open this spreadsheet in the morning and only see the addresses that are scheduled for the current day's date so they can know what is in progress for the day.
 
Upvote 0
Entonces solamente debemos poner la fecha de hoy en la misma fórmula para buscarla. Pero con el formato mm/dd/yy


Excel Formula:
=IFERROR(FILTER(A2:A8,BYROW(J2:AF8,LAMBDA(br,SUM(--ISNUMBER(SEARCH(TEXT(TODAY(),"mm/dd/yy"),br)))))),"Not Exists")
 
Upvote 0
Solution
Estoy feliz de poder leer Español.

¡Gracias por su ayuda!
 
Upvote 0
Entonces solamente debemos poner la fecha de hoy en la misma fórmula para buscarla. Pero con el formato mm/dd/yy
So we just have to put today's date in the same formula to find it. But with the format mm/dd/yy


Estoy feliz de poder leer Español.

¡Gracias por su ayuda!
Sorry about that, sometimes I forget to do the translation, I hope I don't get scolded by the forum moderators.

I appreciate your kindness to accept the text in Spanish and above all that the solution works for you.
:giggle:
 
Upvote 0

Forum statistics

Threads
1,215,088
Messages
6,123,056
Members
449,091
Latest member
ikke

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