Pull date from cell with multiple info

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
582
Office Version
  1. 365
Is it possible to pull the date from a cell, which is typically like this

Excel Formula:
07/01/2021 13:13:46 - Status change: Complete
07/01/2021 13:13:40 - Status change: In QA - BPS
07/01/2021 13:13:36 - Status change: In configuration
07/01/2021 13:13:33 - Status change: Governed
04/01/2021 10:23:52 - Status change: In configuration
04/01/2021 10:23:26 - Status change: Governed
04/01/2021 10:04:40 - Status change: Submitted

I always want to pull the date from the "highest" row in the cell for Status change: In configuration

So, I would want to pull 07/01/2021 in this example.

Each line above is on a separate "row", but is in the same cell (for example N1)
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
How about
Fluff.xlsm
GH
1
207/01/2021 13:13:46 - Status change: Complete 07/01/2021 13:13:40 - Status change: In QA - BPS 07/01/2021 13:13:36 - Status change: In configuration 07/01/2021 13:13:33 - Status change: Governed 04/01/2021 10:23:52 - Status change: In configuration 04/01/2021 10:23:26 - Status change: Governed 04/01/2021 10:04:40 - Status change: Submitted07/01/2021
Sheet1
Cell Formulas
RangeFormula
H2H2=LEFT(FILTERXML("<k><m>"&SUBSTITUTE(G2,CHAR(10),"</m><m>")&"</m></k>","//m[contains(.,'In configuration')][1]"),10)
 
Upvote 2
Will the extract in cell H2 recognise that as a date? For instance, if I put a formula to count dates between 01/01/2023 and 31/01/2023 in please?
 
Upvote 0
If you need it as a date just add +0 to the end of the formula
 
Upvote 1
You, sir (or madam!!) , are a genius :)

Just for my learning can i make it " [contains(.,'In configuration') " or [contains(.,'Off-shore configuration') ?

(Note, unfortunately, I cannot simply just use the word "configuration"

What are the K and m in the formulas doing please?

Thanks once again :)(y):)(y):)(y)
If you need it as a date just add +0 to the end of the formula
 
Upvote 0
Yes, like
Excel Formula:
=LEFT(FILTERXML("<k><m>"&SUBSTITUTE(G2,CHAR(10),"</m><m>")&"</m></k>","//m[contains(.,'In configuration') or contains(.,'Off-shore configuration')][1]"),10)+0
 
Upvote 1
Solution
G E N I U S ! !

I would like to know what the <k> an <m> in the formula do please? :)

Yes, like
Excel Formula:
=LEFT(FILTERXML("<k><m>"&SUBSTITUTE(G2,CHAR(10),"</m><m>")&"</m></k>","//m[contains(.,'In configuration') or contains(.,'Off-shore configuration')][1]"),10)+0
 
Upvote 0
Apologies, one more question on this.... I can see the 10 is extracting the number of characters of the date. If this was an predetermined length of all characters before an "x", can this be adapted once more?

=LEFT(FILTERXML("<k><m>"&SUBSTITUTE(G2,CHAR(10),"</m><m>")&"</m></k>","//m[contains(.,'In configuration')][1]"),10)
 
Upvote 0
Can you post some sample data.
 
Upvote 0
Can you post some sample data.
Something like

2x horses, 129x cats, 30x dogs, 18x white rhinos

So, instead of "In configuration" I would be looking at putting the animal (in this example) and would want the "quantity" before the "x"

With the animal names, I am debating on whether to use "Text to columns" to split these out in the row. An alternate would be using column headers

Initial dataHorsesCatsDogsWhite RhinosAfrican elephantsIndian elephants
2x horses, 129x cats, 30x dogs, 18x white rhinos21293018
2x cats, 19x White Rhinos, 3260x African elephants, 1x Indian elephant21932601
45x Dogs45
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,540
Members
449,038
Latest member
Guest1337

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