Using concatenate with variable outputs.

Newbienew

Active Member
Joined
Mar 17, 2017
Messages
395
Office Version
  1. 2016
Platform
  1. Windows
My formula doesn't work on the different Excel versons. I am looking for a formula that does what the one below does. If B12 has text in it then B11 will be displayed; same goes with C12 and C11 and so on. However, they all need to be joined together with a comma in between each one if the results are true. I attempted to use the concatenate formula but realized I was unsure of how to build it due to row 12 changes up pending different entries.

simply put I would like to duplicate textjoin formula with concatenate or so to work on all verisons.



VISION CORR 20/20NCPNHNSISCESUB QUAL'EDMOS OBLI SERVUS CIT
Note 1XNote 60Note 7072X


=_xlfn.TEXTJOIN(",",,IF(ISTEXT($B$12),RIGHT($B$11,6),""),IF(ISTEXT($C$12),$C$11,""),IF(ISTEXT($D$12),$D$11,""),IF(ISTEXT($E$12),$E$11,""),IF(ISTEXT($F$12),$F$11,""),IF(ISTEXT($G$12),$G$11,""),IF(ISTEXT($H$12),$H$11,""),IF(ISTEXT($I$12),$I$11,""))
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Start slow, don't build teh entire thing at one. Start with the first two cells, then if that works that add the next two cells.

=concatenate(ifB12<>""(B12&", ",""),if(B11<>"",B11&", ","")
 
Upvote 0
Try this
Excel Formula:
=SUBSTITUTE(SUBSTITUTE("$$"&IF(ISTEXT($B$12),","&RIGHT($B$11,6),"")&IF(ISTEXT($C$12),","&$C$11,"")&IF(ISTEXT($D$12),","&$D$11,"")&IF(ISTEXT($E$12),","&$E$11,"")&IF(ISTEXT($F$12),","&$F$11,"")&IF(ISTEXT($G$12),","&$G$11,"")&IF(ISTEXT($H$12),","&$H$11,"")&IF(ISTEXT($I$12),","&$I$11,""),"$$,",""),"$$","")
 
Upvote 1
Solution
If B12 has text in it then B11 will be displayed;
From the image, we have no idea what is B12 or B11. Any reason you can't use 'Mini Sheet' with XL2BB rather than 'Table Only'?

How many columns do you actually have (or might you have)?

Would a vba solution be acceptable?
 
Upvote 0
From the image, we have no idea what is B12 or B11. Any reason you can't use 'Mini Sheet' with XL2BB rather than 'Table Only'?

How many columns do you actually have (or might you have)?

Would a vba solution be acceptable?
I would LOVE a VBA but VBA doesn't work on all platforms. IF this is put in to google sheets or one drive or so Marcos or VBAs dont work. This is why I am trying to use baseline formulas.

I didn't post the mini sheet due to the possible confusion in the formulas in those cells. The top row is 11 bottom row is 12.

The number of columns is just what you see here. Added I was informed the MOS OBLI SERV column does not need to be counted in the formula. It cant be skipped.


ASVAB CAL-WLPRLH247389.xlsb
BCDEFGHI
11VISION CORR 20/20NCPNHNSISCESUB QUAL'EDMOS OBLI SERVUS CIT
12Note 1XNote 60Note 7072X
HOME
Cell Formulas
RangeFormula
B12B12=IF(VLOOKUP($A$6,RATINGS!$A$4:$V$124,14,FALSE)=0,,VLOOKUP($A$6,RATINGS!$A$4:$V$124,14,FALSE))
C12C12=IF(VLOOKUP($A$6,RATINGS!$A$4:$V$124,15,FALSE)=0,,VLOOKUP($A$6,RATINGS!$A$4:$V$124,15,FALSE))
D12D12=IF(VLOOKUP($A$6,RATINGS!$A$4:$V$124,16,FALSE)=0,,VLOOKUP($A$6,RATINGS!$A$4:$V$124,16,FALSE))
E12E12=IF(VLOOKUP($A$6,RATINGS!$A$4:$V$124,17,FALSE)=0,,VLOOKUP($A$6,RATINGS!$A$4:$V$124,17,FALSE))
F12F12=IF(VLOOKUP($A$6,RATINGS!$A$4:$V$124,18,FALSE)=0,,VLOOKUP($A$6,RATINGS!$A$4:$V$124,18,FALSE))
G12G12=IF(VLOOKUP($A$6,RATINGS!$A$4:$V$124,19,FALSE)=0,,VLOOKUP($A$6,RATINGS!$A$4:$V$124,19,FALSE))
H12H12=IF(VLOOKUP($A$6,RATINGS!$A$4:$V$124,20,FALSE)=0,,VLOOKUP($A$6,RATINGS!$A$4:$V$124,20,FALSE))
I12I12=IF(VLOOKUP($A$6,RATINGS!$A$4:$V$124,21,FALSE)=0,,VLOOKUP($A$6,RATINGS!$A$4:$V$124,21,FALSE))
 
Upvote 0
Thanks for the clarifications.

Did you try any of the suggested formulas? It seems to me that the post #3 suggestion does the same thing as your formula.

However, I think this considerably shorter version also does the same thing.
Excel Formula:
=REPLACE(IF(ISTEXT(B12),","&RIGHT(B11,6),"")&IF(ISTEXT(C12),","&C11,"")&IF(ISTEXT(D12),","&D11,"")&IF(ISTEXT(E12),","&E11,"")&IF(ISTEXT(F12),","&F11,"")&IF(ISTEXT(G12),","&G11,"")&IF(ISTEXT(I12),","&I11,""),1,1,"")
 
Upvote 1
@Peter_SSs & @kvsrinivasamurthy I have just attempted to try both formulas, and YES these work amazing and hit the target spot on. I am not as familiar with the Replace or Substitute formula and its application. Thank you so much.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,213
Members
453,024
Latest member
Wingit77

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