Maggie Barr
Board Regular
- Joined
- Jan 28, 2014
- Messages
- 188
Greetings and thank you in advance if you can help. I am on a PC using Excel 2019.
I have a formula that someone generously helped me with that I am using to run a test to see if a series of single observation dates in one sheet (Sheet2) for a species falls outside of a given date range in another sheet (Sheet1) for the same species. It provides me different information dependent on which side of the date window it falls on. This is working right now with the years equal across both data sets, but my data for the single date in Sheet2 will soon have data from multiple years, which means the test will no longer work. I only need to know if the month and day fall outside of a specified range, regardless of the year. With the formula I was using (see below), I copied some of the data and changed the year from 2018 to 2020 and what previously was a recorded as “TooEarly” then became “TooLate” because of the year. I need to be able to have the formula check just the month and day for the one record and tell me if it is before after the other month and day, not looking at year.
If anyone has any advice as to how to modify this formula, or if I should try something else, I would greatly appreciate it. I have also loaded a link to a sample workbook below. In that, the blue cells are the made up dates of the identical data (light green cells) and you can see the different results.
I am aware that I could just create a duplicate column and modify all the years to equal 2018 for the purpose of the test, but I am also trying to learn to bring my data into power query because I am reaching Excels record limit (1 million) with much more to come soon, and with my table running as only a connection, it is not adequately replacing values in my duplicated date column with the Power Query editor. I know I will have to modify the language of this formula for power query, but I will cross that bridge when I get there.
Thank you,
Maggie Barr
Link to file:
https://app.box.com/s/szfp43a1vbf7w5v6poh9w50pyp65c08b
Formula:
'=IF(ISNUMBER(MATCH(A2,Sheet1!A:A,0)),IF(COUNTIFS(Sheet1!A:A,A2,Sheet1!C:C,"<="&B2,Sheet1!D:D,">="&B2)=0,IF(B2>INDEX(Sheet1!D:D,MATCH(A2,Sheet1!A:A,0)),"TooLate","TooEarly"),"DateOkay"),"Sp; Code N/A")
I have a formula that someone generously helped me with that I am using to run a test to see if a series of single observation dates in one sheet (Sheet2) for a species falls outside of a given date range in another sheet (Sheet1) for the same species. It provides me different information dependent on which side of the date window it falls on. This is working right now with the years equal across both data sets, but my data for the single date in Sheet2 will soon have data from multiple years, which means the test will no longer work. I only need to know if the month and day fall outside of a specified range, regardless of the year. With the formula I was using (see below), I copied some of the data and changed the year from 2018 to 2020 and what previously was a recorded as “TooEarly” then became “TooLate” because of the year. I need to be able to have the formula check just the month and day for the one record and tell me if it is before after the other month and day, not looking at year.
If anyone has any advice as to how to modify this formula, or if I should try something else, I would greatly appreciate it. I have also loaded a link to a sample workbook below. In that, the blue cells are the made up dates of the identical data (light green cells) and you can see the different results.
I am aware that I could just create a duplicate column and modify all the years to equal 2018 for the purpose of the test, but I am also trying to learn to bring my data into power query because I am reaching Excels record limit (1 million) with much more to come soon, and with my table running as only a connection, it is not adequately replacing values in my duplicated date column with the Power Query editor. I know I will have to modify the language of this formula for power query, but I will cross that bridge when I get there.
Thank you,
Maggie Barr
Link to file:
https://app.box.com/s/szfp43a1vbf7w5v6poh9w50pyp65c08b
Formula:
'=IF(ISNUMBER(MATCH(A2,Sheet1!A:A,0)),IF(COUNTIFS(Sheet1!A:A,A2,Sheet1!C:C,"<="&B2,Sheet1!D:D,">="&B2)=0,IF(B2>INDEX(Sheet1!D:D,MATCH(A2,Sheet1!A:A,0)),"TooLate","TooEarly"),"DateOkay"),"Sp; Code N/A")