I am trying to extract dates from a cell like this: "Completed: 7/20/20 with primary contingency"
To do so, I used this formula with success:
=MID(A2,MIN(IFERROR(MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789",1)),LEN(A2)+1)),LOOKUP(1,0*MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),ROW(INDIRECT("1:"&LEN(A2)))) + 1 - MIN(IFERROR(MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789",1)),LEN(A2)+1)))
The problem is that not all text strings have just one set of numbers so this MID formula will not work. For example, a cell might say this: "Completed: 7/20/20 with primary contingency, G2 upper" or "Progress: U2, scheduled: 7/20/20 with primary contingency."
How do I get Excel to extract just the date from a cell and exclude all numbers that are not part of that date?
To do so, I used this formula with success:
=MID(A2,MIN(IFERROR(MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789",1)),LEN(A2)+1)),LOOKUP(1,0*MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),ROW(INDIRECT("1:"&LEN(A2)))) + 1 - MIN(IFERROR(MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789",1)),LEN(A2)+1)))
The problem is that not all text strings have just one set of numbers so this MID formula will not work. For example, a cell might say this: "Completed: 7/20/20 with primary contingency, G2 upper" or "Progress: U2, scheduled: 7/20/20 with primary contingency."
How do I get Excel to extract just the date from a cell and exclude all numbers that are not part of that date?