• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Convert number to text string

Hello,


I have a number that I need to convert to the following text string formats. I have successfully converted 45 to the following text string using the custom format:

Wait(45000);


But it does not work with the ones below:


Convert 0.05 to the following text string:

<ParameterString>0.05</ParameterString>

The data varies from 0-2.0

Convert 0 to the following text string:

<Time>0</Time>

The data varies from 0-2500


These are codes for a instrument and the text must be in the exact format above. Can anyone help.


Regards,


Frank
 
If you want 0.05 to appear as

<ParameterString>0.05</ParameterString>

use the custom number format

"<ParameterString>"0.##"</ParameterString>"


for 0

to appear as

<Time>0</Time>

use

"<Time>"0"</Time>"


If Time and ParameterString are meant to be variable use a different tact

="<ParameterString>"&TEXT(A1,"0.##")&"</ParameterString>"


Or if you want to change the string which is in A2

="<"&A2&">"&TEXT(A1,"0.##")&"</"&A2&">"
 
Back
Top