Forum Discussion
aknadler
Aug 02, 2023Copper Contributor
Aligning 1st and Last name column in Excel with similar .jpg file name in separate column for SQL
I have an excel spreadsheet. I have a column listed for first name and another column for last name. I have another column for JPEG images. The file name is similar to the name which is Lastname_Firs...
Fares_Alabsi
Aug 04, 2023Copper Contributor
You can use the **CONCATENATE** function to line up and match the human name to the .jpg file name horizontally on a different column. The **CONCATENATE** function allows you to combine text and values into a single string.
In your case, you would use the **CONCATENATE** function to combine the last name and first name from the first two columns, and then append the .jpg extension. For example, if the last name is "Doe" and the first name is "John", you would use the following formula:
```
=CONCATENATE(LastName, "_", FirstName, ".jpg")
```
This would create the string "Doe_John.jpg". You could then copy and paste this formula into the third column, and it would automatically match the human name to the .jpg file name.
Here is an example of how you would use the **CONCATENATE** function to match the human name to the .jpg file name in Excel:
```
=CONCATENATE(A2, "_", B2, ".jpg")
```
In this example, the first two arguments of the **CONCATENATE** function are the cells that contain the last name and first name. The third argument is the .jpg extension. The result of the formula would be the .jpg file name, which would be placed in the cell that contains the formula.
In your case, you would use the **CONCATENATE** function to combine the last name and first name from the first two columns, and then append the .jpg extension. For example, if the last name is "Doe" and the first name is "John", you would use the following formula:
```
=CONCATENATE(LastName, "_", FirstName, ".jpg")
```
This would create the string "Doe_John.jpg". You could then copy and paste this formula into the third column, and it would automatically match the human name to the .jpg file name.
Here is an example of how you would use the **CONCATENATE** function to match the human name to the .jpg file name in Excel:
```
=CONCATENATE(A2, "_", B2, ".jpg")
```
In this example, the first two arguments of the **CONCATENATE** function are the cells that contain the last name and first name. The third argument is the .jpg extension. The result of the formula would be the .jpg file name, which would be placed in the cell that contains the formula.