SuttieB2404
New Member
- Joined
- Sep 9, 2011
- Messages
- 7
- Office Version
- 365
- Platform
- Windows
Hi I'm trying to write a formula that extracts an invoice reference that is either two capital letters followed by 4 or five numbers from a variable string in a cell.
i.e extract 'AB1234' from 'Invoice 2222 Date: 01/01/2002 AB1234 Ref: A123456'
I found a post that counted double capitals that may be able to modify?
=SUM((CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1)-1)),1))>=64)*(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1)-1)),1))<=90)
*(CODE(MID(A1,ROW(INDIRECT("2:"&LEN(A1))),1))>=64)*(CODE(MID(A1,ROW(INDIRECT("2:"&LEN(A1))),1))<=90))
Cheers
Stu
i.e extract 'AB1234' from 'Invoice 2222 Date: 01/01/2002 AB1234 Ref: A123456'
I found a post that counted double capitals that may be able to modify?
=SUM((CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1)-1)),1))>=64)*(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1)-1)),1))<=90)
*(CODE(MID(A1,ROW(INDIRECT("2:"&LEN(A1))),1))>=64)*(CODE(MID(A1,ROW(INDIRECT("2:"&LEN(A1))),1))<=90))
Cheers
Stu