Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Combine numbers

Status
Not open for further replies.

Drej

Mechanical
Joined
Jul 31, 2002
Messages
971
Location
GB
I have several columns of numbers in my Excel spreadsheet like so:


80 500 2 35
80 535 3 21
..
..
..


Can anyone tell me how I can combine the numbers for one row and place them at the end column to form the number in this format 80-500-2-35?

Cheers for any help.

-- drej --
 
Assuming that
A1 = 80
B1 = 500
C1 = 2
D1 = 35

Then you can concatenate them together in E1 with the following formula:
Code:
=TRIM(A1) & "-" & TRIM(B1) & "-" & TRIM(C1) & "-" & TRIM(D1)

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
you don't necessarily need the TRIM function, either. If the values are indeed numerical only, then the trim function will have no effect and =A1&"-"&B1&"-"&C1&"-"&D1 will yield the same result.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top