SOLVED

Need help with formula

Copper Contributor

I'm trying to take a three digit number i.e. 123 and split it into three pairs; a front pair, a back pair and the outer two numbers form the three pair i.e. 12, 23, 13. I'm having trouble with formula. I tried to copy and past Google Sheets formula 

=join(", ",{left(C3,2)&"x","x"&right(C3,2),"x"&left(C3,1)&right(C3,1)}) in Microsoft Excel but I'm getting an error. So what would be the correct formula?  

8 Replies

Hi Alana,

 

Google Sheets formula not necessary work in Excel, these are different products. Your formula in Excel looks like

=LEFT(C3,2) & "," & RIGHT(C3,2) & "," & LEFT(C3,1) & RIGHT(C3,1)
best response confirmed by Alana Weaver (Copper Contributor)
Solution

Hi,

 

You got that error because there is no function in Excel called: JOIN.

 

Replace this:

=join(", ",{left(C3,2)&"x","x"&right(C3,2),"x"&left(C3,1)&right(C3,1)})

With this:

=LEFT(C3,2)&"x,"&" x"&RIGHT(C3,2)&", x"&LEFT(C3,1)&RIGHT(C3,1)

 Or this:

=LEFT(C3,2)&", "&RIGHT(C3,2)&", "&LEFT(C3,1)&RIGHT(C3,1)

 

Thanks for helping me with formula. It works and giving alternative formula
Thanks for your help also Sergei

If I have a three digit number i.e. 098 that begins with number 0 how do I get Excel to display it? The formula works but its displaying the pairs without number zero i.e. 98x, x98, x98

Excel automatically removes leading zeros, so you have to convert that number to text in order to display the zero it in the formula.

 

You can type an apostrophe (') in front of the number, and Excel will treat it as text.

 

For example:

 

'098

 

NOTE: the apostrophe will be hidden after you exit the cell.

 

Give it a try.

 

You may apply custom format to your cells to display leading zero(es)

ThreeZero.JPG

 

I created the custom type 000 and it still doesn't recognize the zero only the back pair is displayed

1 best response

Accepted Solutions
best response confirmed by Alana Weaver (Copper Contributor)
Solution

Hi,

 

You got that error because there is no function in Excel called: JOIN.

 

Replace this:

=join(", ",{left(C3,2)&"x","x"&right(C3,2),"x"&left(C3,1)&right(C3,1)})

With this:

=LEFT(C3,2)&"x,"&" x"&RIGHT(C3,2)&", x"&LEFT(C3,1)&RIGHT(C3,1)

 Or this:

=LEFT(C3,2)&", "&RIGHT(C3,2)&", "&LEFT(C3,1)&RIGHT(C3,1)

 

View solution in original post