Create a TEXT String based on numbers in a spreadsheet

James8761

Board Regular
Joined
Apr 24, 2012
Messages
156
Office Version
  1. 365
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.
[TABLE="width: 324"]
<colgroup><col><col span="2"><col></colgroup><tbody>[TR]
[TD]Name[/TD]
[TD]Location[/TD]
[TD]Score[/TD]
[TD]Place[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]Nottingham[/TD]
[TD="align: right"]87[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]Nottingham[/TD]
[TD="align: right"]125[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]Nottingham[/TD]
[TD="align: right"]118[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]Nottingham[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]Nottingham[/TD]
[TD="align: right"]98[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]Nottingham[/TD]
[TD="align: right"]105[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]Nottingham[/TD]
[TD="align: right"]85[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]London[/TD]
[TD="align: right"]122[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]London[/TD]
[TD="align: right"]67[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]London[/TD]
[TD="align: right"]61[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]London[/TD]
[TD="align: right"]121[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]London[/TD]
[TD="align: right"]84[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]London[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]London[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]Answer Needed 1. Results at Location[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]Nottingham[/TD]
[TD][/TD]
[TD="align: right"]3118213[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]London[/TD]
[TD][/TD]
[TD="align: right"]1541392[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"]Answer Needed 2. If scored above 80 and Location[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]Nottingham[/TD]
[TD]>80[/TD]
[TD="align: right"]311213[/TD]
[/TR]
[TR]
[TD]John Smith[/TD]
[TD]London[/TD]
[TD]>80[/TD]
[TD="align: right"]1132[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
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,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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