I’m filling up data of names. The columns filled are “First Name”, “Middle Name” and “Last Name”.
There is an excel formula that I’ve created which fills up “Full Name” according to the data in the other columns.
There are some names that don’t have middle name, so the excel formula will remove the double space.
Initial Table:
Afterwards, a new datatable will be created in another sheet and it will contain the new tabulated data. However, when I output the new datatable, it will show the “Full Name” for those who don’t have a middle name with 2 spaces. (eg. “Tommy Tan” instead of “Tommy Tan”)
Expected Result (correct)
Actual Result (wrong)
Why does the output datatable show double space? I wish to only get single space. Like how a normal name looks. Is there any solution to this?
Note that this is a sample data and my real dataset has thousands of records.
Appreciate the help, but I have implemented this formula as mentioned earlier.
=SUBSTITUTE(TRIM(A2&" “&B2&” “&C2&” “& IF(LEN(B2)=0,”“,” “)),” “,” ")
The formula trims the extra space, if there’s no middle name.
and the result is:
but when I read and write this data table onto another sheet / workbook, the output for “Full Name” column changes to:
As you notice, there’s a double space for the values without Middle Name. Why does this happen although the value in the first data table where I retrieve the data from does not have double space?