Extract part of cell based on condition

aziz5353az

New Member
Joined
Mar 18, 2018
Messages
2
Hi excel community



I wonder if I can extract part of a cell based on a condition

for example:


lets say we have this table

Capture.png





I need a way to extract what in column 2 and distribute the results to the lasts columns


I hope the problem is clear .


thanks
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Re: how to extract part of cell based on condition ?

Welcome to the Board.

Try:

Excel 2012
ABCDEF
1IDlinksAAAAAACCCCCC
24345AAA-1,CCC-34AAA-1CCC-34
33453CCC-21,AAA-34,AAA-45AAA-34AAA-45CCC-21
4563CCC-55,CCC-212,AAA-3,AAA-98AAA-3AAA-98CCC-55CCC-212

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
C2{=IFERROR(TRIM(LEFT(SUBSTITUTE(MID($B2,SMALL(IF(MID($B2,ROW(INDIRECT("1:"&LEN($B2)-LEN(C$1)+1)),LEN(C$1))=C$1,ROW(INDIRECT("1:"&LEN($B2)-LEN(C$1)+1))),COUNTIF($C$1:C$1,C$1)),LEN($B2)),",",REPT(" ",LEN($B2))),LEN($B2))),"")}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0
Re: how to extract part of cell based on condition ?

or……….

In C2, copied across to F2 and all copied down 3 rows :

=IFERROR(C$1&LOOKUP(,-MID($B2,FIND(C$1,$B2,FIND(C$1,$B2)+COUNTIF($C$1:C$1,C$1)-1)+LEN(C$1)+1,ROW($1:$15))),"")

Regards
Bosco
 
Upvote 0
Re: how to extract part of cell based on condition ?

Thank you for the effort

but my actual dataset is not on the exact order or data sample I gave

I tried to implement the same with my data but I get blanks
 
Upvote 0
Re: how to extract part of cell based on condition ?

Which formula(s) did you try? Can you post a more realistic sample of your data? It's very hard to build a formula when we don't know what we're really working with.
 
Upvote 0
Re: how to extract part of cell based on condition ?

Another approach without CSE:

Excel Workbook
ABCDEFGHI
1IDlinksAAA1AAA2CCC1CCC2CCC3CCC4DDD1
24345AAA-1,CCC-34,DDD-99,CCC-24AAA-1CCC-34CCC-24DDD-99
33453CCC-21,AAA-34,AAA-45,CCC-2,CCC-45,CCC-12AAA-34AAA-45CCC-21CCC-2CCC-45CCC-12
4563CCC-55,CCC-212,AAA-3,AAA-98AAA-3AAA-98CCC-55CCC-212
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,692
Members
448,979
Latest member
DET4492

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