What is wrong my formula?

azizrasul

Well-known Member
Joined
Jul 7, 2003
Messages
1,304
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Trying to extract a date in any part of a cell. However I can't get the following formula to work.

VBA Code:
=IFERROR(DATEVALUE(LEFT(RIGHT(A2,LEN(A2)-FIND("/",A2)-3))),10)),"")
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
What about:
=IFERROR(LOOKUP(10^10,--TRIM(MID(" "&A1,SEARCH("/*/","0"&A1)-2,ROW(INDIRECT("6:10"))))),"")
 
Upvote 0
If you are not using 365 then a non-volatile option might be

24 02 02.xlsm
AB
1
2Financial Statements dated 31/12/201831/12/2018
3Deposits on 10/5/2018 were 25 million10/05/2018
4I was born on 2/2/19582/02/1958
5When were you born? 
6You can come and join us on 01/01/2021 for training1/01/2021
72/2/1999 is Tom's DoB2/02/1999
8Deposits on 10/5/18 were 25 million10/05/2018
Extract Date
Cell Formulas
RangeFormula
B2:B8B2=IFERROR(--TRIM(MID(A2,MAX(FIND("/",A2)-2,1),FIND(" ",A2&" ",FIND("/",A2))-FIND("/",A2)+2)),"")
 
Upvote 0
I'm using 2016 version. Both

=IFERROR(LOOKUP(10^10,--TRIM(MID(" "&A2,SEARCH("/*/","0"&A2)-2,ROW(INDIRECT("6:10"))))),"")
=IFERROR(--TRIM(MID(A2,MAX(FIND("/",A2)-2,1),FIND(" ",A2&" ",FIND("/",A2))-FIND("/",A2)+2)),"")

worked. Many thanks all.
 
Upvote 0
Glad you have something that is working.
Not sure how big your data is but if very large then using the volatile function INDIRECT could slow your sheet's performance.

I'm using 2016 version. Both
In future, if you are still going to keep three versions in your profile, please specify in post 1 of a thread which one or ones of those three versions the solution has to work in. Then helpers won't be wasting time developing solutions for the wrong version(s). ;)
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,233
Members
449,092
Latest member
SCleaveland

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