Extraction of data into 2 coulmns..!!

rishi.ssh

Board Regular
Joined
May 4, 2012
Messages
60
Hi friends...i am very impressed with the kind of response and help provided here..thanks a lot for giving your time to my new thread :)Ok i have extracted data from mail into excel...t...because i wanna extract two fields of data .... Buyer Id and Comission. which follows a patters similar in all mails just as i will show you below.Buyer ID: xxx-xxxxxxx-xxxxxxxCOMISSION: -$5.2 They are exactly in same patterN like if a macro can find "ID:" I i will began extraction leaving space than the value untill next space is encountered and post in into adjacent column against same cell... Also next it should also find "COMISSION:" AND start extracting value after a aspace till a space or till the value finishes..in another column..Like if data is in B2 ..ID Should come in C2 And Commission in D2....NOTE: EVERY ID CONSISTS OF 19 character no less no more including "-".Commission is of variable length Like -$5.2 or 15.28 or 124.80 ....Upto two decimle points...Please help..
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
b2 =xxx-xxxxxxx-xxxxxxxCOMISSION: -$5.2
c2 =left(a1,19)
d2 =mid(b2,19,11)
e2 =right(trim(b2),len(b2)-30)

Try this^^^^
 
Upvote 0
Hey this wont work..like i said it been extracted from outlook mail...so there are a lots of other stuff in the cell... So i need a macro ehich can find iD: THAN START EXTRACTION ..ALSO for next column It will find comission: and start extraction and eventually post it..against same cell..in different column...already i use MID FUNCTION but i probably need a macro which can do both thse things...if not single than 2 macro..these can be easily achieved by you guys i know :) there is a space i forgot to add in my post after each values...sorry
 
Last edited:
Upvote 0
I didn't realize "buyer id: " was part of the cell value. Try this...
A1 =Buyer ID: xxx-xxxxxxx-xxxxxxxCOMISSION: -$5.2
B1 =MID(A1,FIND("ID: ",A1)+4,19)
C1 =MID(A1,FIND("COMISSION",A1),11)
D1 =RIGHT(A1,LEN(A1)-FIND("COMISSION",A1)-10)
 
Upvote 0
I have already tried that... And that Column D is not needed...But i would rather want a Macro for it..Anyways i am grateful to you for your kind help.For sample....so commission: and id: can be anywhere....for example..Cell A will look likeThis is your new buyer information Bla bla.....Buyer ID: 143-2222222-7777777 Buyet Name: Michele cohle Address: xxxxxx xxxx Other Information: Xyz COMISSION: -$51.19 Then more other linesNow what i want in B2 is just the IDAND C2 just the commission in this case -$51.19R u in fb..?
 
Upvote 0

Forum statistics

Threads
1,206,754
Messages
6,074,749
Members
446,082
Latest member
fgiron83

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