Format Syntax

JW

Board Regular
Joined
Mar 17, 2002
Messages
72
Hi, I'm looking to extract agreement numbers from one spreadsheet to a new one. These agreements will either be ###-######-## or ###.######.## (where # is a number between 0 and 9), and where one exists in the original there will be one agreement per row . Can anyone help me with the correct syntax to recognise these two formats, using the FIND function. Thanks for any assistance (J)
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
replace # with ? as # is not defind in find. or the , the object should be text and not number. The ? will accept even alphabet but you have no choice. Anyway, the - and , will be the special character to find which can be enough to serve your requirement.
 
Upvote 0
Thanks for the responses so far. I'm getting my data via OCR and text file from printed invoices and the differences in spacing are causing me the problems. Below is a snapshot of what I'm working with (sorry, Coolio's 2.42 has hit a snag), and I'd like to:
1) Identify each agreement number (ie 267-611194-28) and
2) Identify the first (net) amount associated with this (ie £S9S.42)

I thought this would be best using VBA, but I'm still struggling to select the values and paste them into columns A and B of a new sheet (say "TotalSheet") in the same workbook. Can anyone throw some further light on the syntax? Thanks again (J)

267-611194-28 ******* £S9S.42 £104.20 £699.62
267-623978-01 ******* £74.19 £12.98 £87.17
267-6S3348-09 ****** £86.70 £IS.17 £101.87 .
267-6S3382-13 ******* £108.66 £19.02 £127.68 .
306 OL. 267-653405-18 ******* £35.97 £6.29 £42.26
106 XN 267-65344S-20 ******* £4.S8 £0.80 £S.38 .
106 XN 267-653446-20 ******* £4.S8 £0.80 £5.38 .
267-6535S5-14 ******* £11.22 £1.96 £13.18
267.6S3567-09 ******* £79.66 £13.94 £93.60
 
Upvote 0
That's the OCR for you, should read £595.42 - I wondered if they could all be picked up by (currency) format
 
Upvote 0
What about this?
Column B C and D is just to avoid an extremely long formula.
This seems to work for at least the data example you provided.
Book2.xls
ABCDEF
1OriginalNumberValue
2267-611194-28*******595.42104.20699.6214221267-611194-28595.42
3267-623978-01*******74.1912.9887.1714221267-623978-0174.19
4267-6S3348-09******86.70IS.17101.87.14211267-6S3348-0986.70
5267-6S3382-13*******108.6619.02127.68.14221267-6S3382-13108.66
6306OL.267-653405-18*******35.976.2942.26488267-653405-1835.97
7106XN267-65344S-20*******4.580.80S.38.477267-65344S-204.58
8106XN267-653446-20*******4.580.805.38.477267-653446-204.58
9267-6535S5-14*******11.221.9613.1814221267-6535S5-1411.22
10267.6S3567-09*******79.6613.9493.6014221267.6S3567-0979.66
Sheet2
 
Upvote 0
Seems like you cannot wiew the formulas I posted. I wonder why? It has happend before!

Anyway:
B2 =FIND(" ",A2)
C2 =FIND(" ",A2,FIND(" ",A2)+1)
D2 =MAX(IF(B2<13,B2,1),IF(C2<13,C2,1))
E2 =MID(A2,MIN(FIND("-",A2,D2),(FIND(".",A2,D2)))-3,13)
F2 =MID(A2,FIND("£",A2,1)+1,FIND(" ",A2,FIND("£",A2,1))-FIND("£",A2,1))
 
Upvote 0

Forum statistics

Threads
1,221,687
Messages
6,161,287
Members
451,695
Latest member
Doug Mize 1024

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