May 09 2021 02:47 PM
May 09 2021 02:47 PM
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
May 26 2021 03:32 AM
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.
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.
Jul 06 2021 05:53 AM
Jul 06 2021 09:49 AM
Jul 06 2021 11:07 AM - edited Jul 06 2021 11:08 AM
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
Jul 07 2021 10:47 AM
Jul 07 2021 11:17 AM
Jul 10 2021 04:26 AM
Jul 10 2021 04:40 AM
Jul 10 2021 06:41 AM
Jul 10 2021 09:31 AM
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.
Alternatively, the condition may be used in a FILTER formula.
Avoiding the use of add-ins one could then have
Jul 10 2021 10:21 AM
Jul 10 2021 01:23 PM
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.