Create a TEXT String based on numbers in a spreadsheet

James8761

Board Regular
Joined
Apr 24, 2012
Messages
154
Office Version
  1. 2019
Platform
  1. Windows
Hi All,

I am trying to create a spreadsheet for a cycling l club I am in. I am trying to build a text string of numbers based on results achieved.

The first one I am trying to do is look up a persons name and their results at a certain location. So for John Smith from the results below I would like a formula that looks at John Smith and Nottingham and gives the answer 3118213.

Secondly I am testing the accuracy of the scores we give. So when John Smith rides at Nottingham and he is given a score greater than 80 what is his results. The answer is 311213.

Does anyone know if this is possible? Thanks for any help.
NameLocationScorePlace
John SmithNottingham873
John SmithNottingham1251
John SmithNottingham1181
John SmithNottingham368
John SmithNottingham982
John SmithNottingham1051
John SmithNottingham853
John SmithLondon1221
John SmithLondon675
John SmithLondon614
John SmithLondon1211
John SmithLondon843
John SmithLondon199
John SmithLondon1002
Answer Needed 1. Results at Location
John SmithNottingham3118213
John SmithLondon1541392
Answer Needed 2. If scored above 80 and Location
John SmithNottingham>80311213
John SmithLondon>801132

<colgroup><col><col span="2"><col></colgroup><tbody>
</tbody>
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
which excel version are you using?
better still, could you check if the TEXTJOIN() function is available on your excel?
 
Upvote 0
Thanks for the reply Alan. I'm on O365 and yes I see the TEXTJOIN function.
 
Upvote 0
that will be much easier try this, 0 in Col H will give a full list


Book1
ABCDEFGHI
1NameLocationScorePlace
2John SmithNottingham873John SmithNottingham80311213
3John SmithNottingham1251John SmithLondon10011
4John SmithNottingham1181John SmithLondon01541392
5John SmithNottingham368
6John SmithNottingham982
7John SmithNottingham1051
8John SmithNottingham853
9John SmithLondon1221
10John SmithLondon675
11John SmithLondon614
12John SmithLondon1211
13John SmithLondon843
14John SmithLondon199
15John SmithLondon1002
Sheet7
Cell Formulas
RangeFormula
I2{=SUBSTITUTE(TEXTJOIN(,,IF($A$2:$A$15=F2,IF($B$2:$B$15=G2,IF($C$2:$C$15>H2,$D$2:$D$15,"")))),FALSE,"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Thanks very much, Alan. I input that and it did exactly what I wanted.......one more question. If I just wanted results for John Smith and Nottingham what would the formula be please?
 
Upvote 0
Thanks very much, Alan. I input that and it did exactly what I wanted.......one more question. If I just wanted results for John Smith and Nottingham what would the formula be please?

you can just put 0 in H2 to get the full string, don't need to change formula


Book1
ABCDEFGHI
1NameLocationScorePlace
2John SmithNottingham873John SmithNottingham03118213
3John SmithNottingham1251John SmithLondon10011
4John SmithNottingham1181John SmithLondon01541392
5John SmithNottingham368
6John SmithNottingham982
7John SmithNottingham1051
8John SmithNottingham853
9John SmithLondon1221
10John SmithLondon675
11John SmithLondon614
12John SmithLondon1211
13John SmithLondon843
14John SmithLondon199
15John SmithLondon1002
Sheet7
Cell Formulas
RangeFormula
I2{=SUBSTITUTE(TEXTJOIN(,,IF($A$2:$A$15=F2,IF($B$2:$B$15=G2,IF($C$2:$C$15>H2,$D$2:$D$15,"")))),FALSE,"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
Yep, thanks Alan. Say I didn't have Column C though or didn't want it anymore. (We are thinking of getting rid of that). Could I just delete part of the formula?
 
Upvote 0
you can use this instead

Code:
=SUBSTITUTE(TEXTJOIN(,,IF($A$2:$A$15=F2,IF($B$2:$B$15=G2,$D$2:$D$15,""))),FALSE,"")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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