searching for dates to trigger an action.

%3CLINGO-SUB%20id%3D%22lingo-sub-2339397%22%20slang%3D%22en-US%22%3Esearching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2339397%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20a%20Mac%20with%20Microsoft%20365.%20%26nbsp%3BI%20have%20another%20question%20regarding%20using%20Excel.%3C%2FP%3E%3CP%3EMy%20spreadsheet%20involves%20three%20columns%20and%20many%20rows.%20%26nbsp%3BI%20am%20trying%20to%20design%20a%20formula%20to%20allow%20me%20to%20search%20Column%20B%20for%20any%20Year%20date%20between%201875%20and%201895.%20%26nbsp%3BMy%20B%20column%20looks%20like%20the%20following%20%3A%3C%2FP%3E%3CTABLE%20border%3D%220%22%20width%3D%22904%22%20cellspacing%3D%220%22%20cellpadding%3D%220%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%22904%22%20height%3D%2235%22%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2235%22%3E22%20Mar%201882%20-%20East%20Randolph%2C%20Cattaraugus%2C%20New%20York%2C%20USA%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2235%22%3E9%20August%201931%20-%20East%20Randolph%2C%20Cattaraugus%20County%2C%20New%20York%2C%20USA%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2235%22%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2235%22%3E%3CP%3EI%20want%20to%20search%20all%20rows%20in%20Column%20B%20to%20determine%20if%20they%20contain%20a%20year%20date%20between%201875%20and%201895.%20%26nbsp%3BIf%20it%20does%20contain%20such%20a%20date%20I%20want%20to%20either%20conditionally%20format%20that%20row%20or%20move%20it%20to%20a%20different%20area%20of%20the%20sheet.%20%26nbsp%3BCan%20this%20be%20done%3F%20%26nbsp%3BI%20have%20tried%20IF%2C%20AND%2C%20FIND%20etc%20but%20I%20can't%20find%20a%20combo%20that%20will%20do%20this.%20%26nbsp%3BAS%20yet%20there%20has%20been%20success.%20I%20am%20not%20sure%20if%20the%20dates%20read%20as%20text%20so%20I%20can't%20use%20the%20%26gt%3Bor%26lt%3B%20to%20find%20the%20proper%20dates.%20%26nbsp%3BJohn%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2235%22%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2386801%22%20slang%3D%22en-US%22%3ERe%3A%20searching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2386801%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1036251%22%20target%3D%22_blank%22%3E%40jhicks5charternet%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20are%20several%20challenges%20here.%20Getting%20the%20dates%20to%20be%20extracted%20from%20the%20text%20is%20one%20of%20them.%3C%2FP%3E%0A%3CP%3EThe%20file%20attached%20has%20one%20possible%20solution%20for%20that.%3C%2FP%3E%0A%3CP%3EThe%20bigger%20problem%2C%20though%2C%20is%20that%20the%20dates%20you%20want%20to%20work%20with%20are%20before%201990%20and%20the%20Excel%20date%20numbering%20system%20starts%20on%20January%201%2C%201990.%20Any%20date%20before%20that%20is%20not%20recognized%20by%20Excel%20natively.%3C%2FP%3E%0A%3CP%3EI%20did%20not%20work%20on%20a%20solution%20for%20that%2C%20but%20I%20found%20this%20article%20that%20may%20be%20a%20good%20starting%20point.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fexceluser.com%2F1057%2Fhow-to-work-with-dates-before-1900-in-excel%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fexceluser.com%2F1057%2Fhow-to-work-with-dates-before-1900-in-excel%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPower%20Query%20recognizes%20dates%20before%201990%20and%20can%20handle%20the%20filtering%20aspect%20very%20easily.%3C%2FP%3E%0A%3CP%3ETwo%20challenges%20there%3A%20Power%20Query%20functionality%20in%20Excel%20for%20Mac%20is%20limited%2C%20and%20when%20you%20load%20your%20data%20into%20Excel%20you%20would%20have%20to%20convert%20those%20dates%20to%20text.%20But%20if%20all%20you%20care%20about%20is%20to%20find%20those%20dates%2C%20you%20can%20do%20that%20in%20Power%20Query%20and%20then%20have%20the%20results%20loaded%20as%20text%20into%20Excel.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20hope%20this%20helps.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2519930%22%20slang%3D%22de-DE%22%3ERe%3A%20searching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2519930%22%20slang%3D%22de-DE%22%3EThe%20First%20Date%20in%20Excel%20is%20the%2001.01.1900%20Not%2001.01.1990!!!!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2520197%22%20slang%3D%22en-US%22%3ERe%3A%20searching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2520197%22%20slang%3D%22en-US%22%3EThank%20you.That%20is%20good%20to%20know%20but%20the%20dates%20I%20need%20to%20look%20for%20are%20(%26lt%3B%3D%201875)%20and%20(%26gt%3B%3D%201899).%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2520500%22%20slang%3D%22en-US%22%3ERe%3A%20searching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2520500%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1036251%22%20target%3D%22_blank%22%3E%40jhicks5charternet%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EIf%20you%20only%20want%20to%20search%20a%20value%20in%20your%20Text%20%26gt%3B%3D1875%20an%20%26lt%3B%3D1895%20you%20can%20use%20this%20formula%20in%20your%20conditional%20formating%20rule%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3DSUM(IFERROR(FIND(SEQUENCE(21%3B%3B1875)%3BB2)%3B0))%26nbsp%3B%20%26nbsp%3B%26lt%3B%20maybe%20you%20have%20to%20repace%20semicolon%20with%20comma%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22German_Chris_0-1625594722425.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F293824iF8D55A1FA39CCE96%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22German_Chris_0-1625594722425.png%22%20alt%3D%22German_Chris_0-1625594722425.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2520823%22%20slang%3D%22en-US%22%3ERe%3A%20searching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2520823%22%20slang%3D%22en-US%22%3ECorrect!%20My%20typo%20above.%20Sorry%20for%20the%20confusion.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2520824%22%20slang%3D%22en-US%22%3ERe%3A%20searching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2520824%22%20slang%3D%22en-US%22%3ESorry%2C%20I%20cannot%20help%20with%20Excel%20for%20Mac.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2524330%22%20slang%3D%22en-US%22%3ERe%3A%20searching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2524330%22%20slang%3D%22en-US%22%3EChris%2C%20I%20Tried%20using%20The%20above%20formula%20after%20substitution%20of%20the%20%22%2C%22%20and%20it%20worked%20somewhat.%20It%20did%20not%20pick%20the%20proper%20dates.%20In%20fact%20I%20can't%20figure%20out%20why%20it%20picked%20what%20it%20did%2C%20%2FUsers%2Fjohn%2FDesktop%2FScreen%20Shot%202021-07-07%20at%201.36.38%20PM%20(2).png%3CBR%20%2F%3EJohn%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2524430%22%20slang%3D%22en-US%22%3ERe%3A%20searching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2524430%22%20slang%3D%22en-US%22%3E%40jhicksScharternet%3CBR%20%2F%3EI%20think%20you%20want%20to%20show%20a%20screenshot%2C%20but%20it%20doesn%60t%20show%20here.%20Please%20try%20again.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2526095%22%20slang%3D%22en-US%22%3ERe%3A%20searching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2526095%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1068158%22%20target%3D%22_blank%22%3E%40German_Chris%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screen%20Shot%202021-07-07%20at%201.36.38%20PM%20(2).jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F294178iFB73C7CDEA3C7E42%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screen%20Shot%202021-07-07%20at%201.36.38%20PM%20(2).jpeg%22%20alt%3D%22Screen%20Shot%202021-07-07%20at%201.36.38%20PM%20(2).jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2532893%22%20slang%3D%22en-US%22%3ERe%3A%20searching%20for%20dates%20to%20trigger%20an%20action.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2532893%22%20slang%3D%22en-US%22%3ECan%20you%20show%20me%20the%20formula%20in%20your%20conditional%20formating%20please.%3C%2FLINGO-BODY%3E
Contributor

I am using a Mac with Microsoft 365.  I have another question regarding using Excel.

My spreadsheet involves three columns and many rows.  I am trying to design a formula to allow me to search Column B for any Year date between 1875 and 1895.  My B column looks like the following :

 
22 Mar 1882 - East Randolph, Cattaraugus, New York, USA
9 August 1931 - East Randolph, Cattaraugus County, New York, USA
 

I want to search all rows in Column B to determine if they contain a year date between 1875 and 1895.  If it does contain such a date I want to either conditionally format that row or move it to a different area of the sheet.  Can this be done?  I have tried IF, AND, FIND etc but I can't find a combo that will do this.  AS yet there has been success. I am not sure if the dates read as text so I can't use the >or< to find the proper dates.  John

 

 
19 Replies

@jhicks5charternet 

There are several challenges here. Getting the dates to be extracted from the text is one of them.

The file attached has one possible solution for that.

The bigger problem, though, is that the dates you want to work with are before 1990 and the Excel date numbering system starts on January 1, 1990. Any date before that is not recognized by Excel natively.

I did not work on a solution for that, but I found this article that may be a good starting point.

https://exceluser.com/1057/how-to-work-with-dates-before-1900-in-excel/

 

Power Query recognizes dates before 1990 and can handle the filtering aspect very easily.

Two challenges there: Power Query functionality in Excel for Mac is limited, and when you load your data into Excel you would have to convert those dates to text. But if all you care about is to find those dates, you can do that in Power Query and then have the results loaded as text into Excel.

 

I hope this helps.

 

 

 

Celia, For various reasons I lost sight of this project and am now getting back to it. I know nothing of Power Query but when I try to get to it I am told that I must go to settings and download the ODBC Driver Manager and set up the database driver. I do not know where to find this . Its it actually another program? Since I am on Office 365 and a Mac, I am not sure sometimes that the directions apply to me or I am just not understanding. John Hicks
The First Date in Excel is the 01.01.1900 Not 01.01.1990!!!!
Thank you.That is good to know but the dates I need to look for are (<= 1875) and (>= 1899).

@jhicks5charternet 
If you only want to search a value in your Text >=1875 an <=1895 you can use this formula in your conditional formating rule:

=SUM(IFERROR(FIND(SEQUENCE(21;;1875);B2);0))   < maybe you have to repace semicolon with comma

German_Chris_0-1625594722425.png

 

Correct! My typo above. Sorry for the confusion.
Sorry, I cannot help with Excel for Mac.
Chris, I Tried using The above formula after substitution of the "," and it worked somewhat. It did not pick the proper dates. In fact I can't figure out why it picked what it did, /Users/john/Desktop/Screen Shot 2021-07-07 at 1.36.38 PM (2).png
John
@jhicksScharternet
I think you want to show a screenshot, but it doesn`t show here. Please try again.
Can you show me the formula in your conditional formating please.
Please try to change the B2 in the formula to B1.
Wow, That did straighten the results. Though it still is missing some of the dates, it does pick up most of them. In a small sample I found 1896,1897,1898,1899 Not including in the highlighted. Is that a factor of the 21 in the formula? My brain is having difficulty understanding how the functions you used allow for this result. I understand conditional formatting but would never have picked those functions to try. Thank you, John
Hi,
I‘m happy That I could help.
Yes, the formula checks values from 1875 to 1895 (pls See your first Post) . If you wanz to check until 1899 change the 21 to 24, that should do it.
Sequenzen function gives you an Array of numbers-> {1875, 1876, … , 1899}
Find function check If one of this numbers is in the cell value and gives you the position of an error .
Iferror changes the errors to 0
SUM adds all positions in one cell.
If the sum is> 0 the conditional formating interprets this as True

Easy isn’t ist?
It is not so easy for this old mind, but its is getting through slowly with the help of people like you. Thank you again. John

@jhicks5charternet 

Unsurprisingly, the best solution depends on the tools available.  Given access to regular expressions (here I use Charles Williams's Fast Excel) the first 4-digit string, giving the year, may be extracted for each row and presented as a conditional format icon.

 

image.png

Alternatively, the condition may be used in a FILTER formula. 

Avoiding the use of add-ins one could then have

 

image.png

Peter, Thank you for this information. These formulas look interesting but I do not know enough to know where to enter them. Could you elaborate more on the basics of how to enter these and were to enter these? Thanks John Hicks

@jhicks5charternet 

Hi John

Not so mysterious really; they are 'ordinary' worksheet dynamic array formulas.  Ordinary for me that is, others may not agree.  The starting point is the defined name 'entry' that I applied to your data entry column, containing a list of dates and addresses.  The function rgx.MID comes from a paid add-in so is shown for information but is of little relevance unless you have access to the add-in.

 

The formula contained in cell C3 generates 1 or 0 as a dynamic array depending on whether the date lies within the specified period or not.  This is taken a step further in cell F3 when the function FILTER is applied to remove entries that do not lie within the specified period.