Data Extract Help

npotapchuk

New Member
Joined
Nov 30, 2016
Messages
4
Good Morning
I was trying to working to extract a specific code of data based on information that is provided to me in a file that I cannot manipulate.

What I am trying to do is have column A format based on criteria on column C. I am given the below information in B-D was was able to set the new format in column A, however was struggling to use one formula to drag down as row 2 has 4 characters and not 3 before the dates/numbers that I need to extract.

I set up the below formula which works to format in Column A but am struggling to set up a new statement to represent to pull the new data if there are 4 characters and not 3.

Any help would be greatly appreciated.

IF(OR(ISBLANK(B2),D2<>"Option"),"",CONCATENATE(LEFT(C2,3)," ",RIGHT(LEFT(C2,10),7),CONCATENATE(IF(LEN(RIGHT(C2,LEN(C2)-10)*1000)=5,"000",IF(LEN(RIGHT(C2,LEN(C2)-10)*1000)=6,"00",IF(LEN(RIGHT(C2,LEN(C2)-10)*1000)=7,"0"))),RIGHT(C2,LEN(C2)-10)*1000)))



Column A Column B Column C Column D
Account #Security IDSecurity Type
EEM 161202C000365001234EEM161202C36.5Option
#VALUE!1234SPXW161202C2185Option
<colgroup><col width="122" style="width: 92pt; mso-width-source: userset; mso-width-alt: 4461;"> <col width="117" style="width: 88pt; mso-width-source: userset; mso-width-alt: 4278;" span="3"> <tbody> </tbody>
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I would like to have a formula that looks like in Column A that would should be the same result in Row 2 SPWX161202C02185000 which is the same as the result in Row 1 but because the Sec ID shows 4 charactes (SPWX) and not 3 characters (EEM) before the date it errors out.
 
Upvote 0
Hi,

Maybe this

=IF(OR(ISBLANK(B2),D2<>"Option"),"",LEFT(C2,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},C2&"0123456789"))-1)&MID(C2,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},C2&"0123456789")),SEARCH("C",C2)-MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},C2&"0123456789")))&"C"&MID(C2,SEARCH("C",C2)+1,99)*1000)
 
Upvote 0
That formula works for the SPWX but when now dragged to the cell referencing EEM (3 characters) you get an error. Believe I just need to set up an if/than statement for the two. Any thoughts?
 
Upvote 0

Forum statistics

Threads
1,214,539
Messages
6,120,100
Members
448,944
Latest member
SarahSomethingExcel100

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