Help to get characters from different cells based on same character

gargilang

New Member
Joined
Jun 17, 2022
Messages
19
Office Version
  1. 365
Platform
  1. Windows
Hello, I would like to know if it's possible to have some formula to get the specific characters from two or three different cells based on same character in it. I am using this formula at the moment
Excel Formula:
=LEFT(A2,FIND("_",A2)-1)
to get the characters I want. for example below table:
1_aaaa_x1
2_aaaa_y2
3_bbbb_x3

Now what I want is something like this:
1_aaaa_x1, 2
2_aaaa_y2, 1
3_bbbb_x3, 4, 5
4_bbbb_y4, 3, 5
5_bbbb_z5, 3, 4

And now if it's not too much to ask already, is it also possible to have the formula to add "&" to the cell, for example:
1_aaaa_x1 & 2
2_aaaa_y2 & 1
3_bbbb_x3, 4 & 5
4_bbbb_y4, 3 & 5
5_bbbb_z5, 3 & 4
if not than it's totally okay as this is only for aesthetic.

I hope it makes sense. Kindly let me know if it's possible. Thank you for your help in advance.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
In that case what version of xl are you using at work?
 
Upvote 0
Ouch, that is a very old version of xl, it must be from 2019 or early 2020.
It will be simpler to use your two helper columns like
Fluff.xlsm
ABCD
1
21aaaa1_aaaa_x1 & 2
32aaaa2_aaaa_y2 & 1
43bbbb3_bbbb_x3, 4 & 5
54bbbb4_bbbb_y4, 3 & 5
65bbbb5_bbbb_z5, 3 & 4
Data
Cell Formulas
RangeFormula
D2:D6D2=SUBSTITUTE(TEXTJOIN(", ",,A2,IF(($B$2:$B$10=B2)*($A$2:$A$10<>A2),$A$2:$A$10,"")),","," &",COUNTIFS($B$2:$B$10,B2)-1)
 
Upvote 0
Ouch, that is a very old version of xl, it must be from 2019 or early 2020.
It will be simpler to use your two helper columns like
Fluff.xlsm
ABCD
1
21aaaa1_aaaa_x1 & 2
32aaaa2_aaaa_y2 & 1
43bbbb3_bbbb_x3, 4 & 5
54bbbb4_bbbb_y4, 3 & 5
65bbbb5_bbbb_z5, 3 & 4
Data
Cell Formulas
RangeFormula
D2:D6D2=SUBSTITUTE(TEXTJOIN(", ",,A2,IF(($B$2:$B$10=B2)*($A$2:$A$10<>A2),$A$2:$A$10,"")),","," &",COUNTIFS($B$2:$B$10,B2)-1)
Thank you, thank you, and once again thank you for keep answering. But unfortunately even with the Substitute, it still doesn't work.
 

Attachments

  • Screenshot 2022-06-17 145957.png
    Screenshot 2022-06-17 145957.png
    12 KB · Views: 4
Upvote 0
Forgot, you will need to confirm it with Ctrl Shift Enter, rather than just Enter.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Ouch, that is a very old version of xl, it must be from 2019 or early 2020.
It will be simpler to use your two helper columns like
Fluff.xlsm
ABCD
1
21aaaa1_aaaa_x1 & 2
32aaaa2_aaaa_y2 & 1
43bbbb3_bbbb_x3, 4 & 5
54bbbb4_bbbb_y4, 3 & 5
65bbbb5_bbbb_z5, 3 & 4
Data
Cell Formulas
RangeFormula
D2:D6D2=SUBSTITUTE(TEXTJOIN(", ",,A2,IF(($B$2:$B$10=B2)*($A$2:$A$10<>A2),$A$2:$A$10,"")),","," &",COUNTIFS($B$2:$B$10,B2)-1)
I am sorry. I guess it's on me that I never mentioned it in the first thread. But now I realized that this works for all the order has value more than one. But if it's only one order than it gives #VALUE! Error.
 

Attachments

  • Screenshot 2022-06-17 145957.png
    Screenshot 2022-06-17 145957.png
    16.3 KB · Views: 4
Upvote 0

Forum statistics

Threads
1,215,180
Messages
6,123,504
Members
449,101
Latest member
mgro123

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