Counting how many entries you get after preforming a Text-to-Columns operation.

WassimN

New Member
Joined
Nov 3, 2017
Messages
44
Hello Marvelous EXCELers,

Here is what I have:
In cell A2 I have a value (numeric), in cell B2 a set of codes (alphabetic) delimited with a comma.

Here is what I need:
I need to find out how many entries will be parsed into individual columns if I perform a Text-To-Columns operation on cell B2, once I find out that number divide the numeric value in A2 by that number (the count of how many individual codes are generated).

Example:
OK so lets say that in A2 I have 123456, and in B2 I have ABC,DEF,GHI when I perform a Text-to-Columns I will end up with ABC in B2, DEF is C2, and GHI in D2. that would mean I have to divide the value in A2 by 3.

What I have tried so far:
I tried using the Excel is Fun Trick # 6 to get the value at the end of the row after the Text-To-Columns but this trick does not appear to work on alphabetic data?!

Any ideas?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try

=A2/(LEN(B2)-LEN(SUBSTITUTE(B2,",",""))+1)
 
Upvote 0
Thanks Peter_SSs
Wow sometimes you can't see the foreset from the trees. This is a very elegent solution that I did not think about.

Way to Go! Sir.

Thanks.
 
Upvote 0
Thanks Peter_SSs
Wow sometimes you can't see the foreset from the trees. This is a very elegent solution that I did not think about.

Way to Go! Sir.

Thanks.
You are very welcome. :)
 
Upvote 0

Forum statistics

Threads
1,215,444
Messages
6,124,892
Members
449,194
Latest member
JayEggleton

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