Count and output letters in order

bestnagi

New Member
Joined
Mar 12, 2013
Messages
14
What is the best way to have the table output the letters in certain order and certain number of time.

Table has input X,Y,Z . For each X,Y,Z, it shows how many times they are repeated in the output in that order X,Y,Z.

XYZ
211XXYZ
120XYY

<tbody>
</tbody>
 
Last edited:
That works prefect!
That's good news and thanks for letting us know.
However, you have had 3 suggestions since you last posted and it would be helpful to readers of the thread if they could identify which suggestions you have tried and which one this comment refers to. :)
 
Upvote 0

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
bestnagi,

When you respond to your helper, please use their site ID/username/handle.

This will keep thread clutter to a minimum and make the discussion easier to follow.
 
Upvote 0
Another version:

=MID(REPT($A$1,$A2)&REPT($B$1,$B2)&REPT($C$1,$C2),COLUMNS($A:A),1)
Excel Workbook
ABCDEFGH
1XYZ
2211XXYZ
3120XYY
4000
5004ZZZZ
6301XXXZ
7400XXXX
8020YY
Sheet
 
  • Like
Reactions: shg
Upvote 0
Another version:

=MID(REPT($A$1,$A2)&REPT($B$1,$B2)&REPT($C$1,$C2),COLUMNS($A:A),1)
Another good one István.
I would, however, recommend one small change. As it stands your formula returns the correct results. However if the user now decides to separate the data and the output by inserting a new column D the results will be incomplete.
I think it would be more robust if the column count was based on where the formulas actually reside:

=MID(REPT($A$1,$A2)&REPT($B$1,$B2)&REPT($C$1,$C2),COLUMNS($D:D),1)
 
Upvote 0

Forum statistics

Threads
1,215,356
Messages
6,124,471
Members
449,163
Latest member
kshealy

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