Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping zero as a real value in the Concatenate Function 1

Status
Not open for further replies.

fetraining

Aerospace
Jul 29, 2008
17
0
0
I use the Concatenate function a lot to group data into a comma deliminated string to paste into various FEA input files.

A simple example is to calculate x,y,z grid coordinates, say (23.4,45.6,78,9) stored in A2:A4 and then produce a string such as:
" GRID,23,23.4,45.6,78,9"
where GRID is a keyword and 23 is the integer ID stored in A1.

I use:

Concatenate("GRID",A1,",",A2,",",A3,",",A4)

The problem is if I have a 0.0 coordinate, then the Concatenate function returns 0 (integer) in the string. Most FE codes are very picky and need a real value as 0.0, and will fail on 0.

I would prefer to avoid using a macro or VB as it is often done 'on the fly'.

Any suggestions very welcome,

regards,
Tony


Tony Abbey
 
Replies continue below

Recommended for you

Use SUBSTITUTE:

[tt]=SUBSTITUTE(CONCATENATE("GRID,",TEXT(A1,"0.0000E+0"),",",TEXT(A2,"0.0000E+0"),",",TEXT(A3,"0.0000E+0"),",",TEXT(A4,"0.0000E+0")),"E","")[/tt]

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Status
Not open for further replies.
Back
Top