Hi everyone!
I’m currently working on transforming name data in my dataset, and I'm encountering some challenges with my formulas. I need to rearrange names based on certain conditions while ensuring no data is lost or incorrectly formatted.
Context:
- I have three columns:
Vorname,Nachname, andWeitere Zugehörige Personen. - The
Vornamecolumn may sometimes contain full names or just first names. - The
Nachnamecolumn can also contain full names (with spaces) or proper last names. - The
Weitere Zugehörige Personencolumn may be empty or contain names.
Requirements:
- If
Nachnamecontains a full name (two words separated by a space) andWeitere Zugehörige Personenis empty, I want to transfer theNachnametoWeitere Zugehörige Personen. - If
Weitere Zugehörige Personenalready contains a name, I want to append theNachnameto it, separated by a comma. - If the
Nachnamecolumn contains a last name, it should remain unchanged unless it meets the criteria above.
Current Issue:
I attempted the following formula in the Weitere Zugehörige Personen column:
javascript
Code kopieren
if(
value.trim() == "",
if(
Nachname.trim().contains(" ") &&
!Vorname.trim().contains(Nachname.trim()),
if(
Weitere_Zugehörige_Personen.trim() == "",
Nachname.trim(),
Weitere_Zugehörige_Personen.trim() + ", " + Nachname.trim()
),
value
),
value
)
However, I encountered a parsing error, specifically "Parsing error at offset 60: Unknown function or control named".
Here is an example of what I am working with:

My previous transformations worked. The end result I want is that the first names are in Vorname, the last names are in Nachname, and the names of the other people are in Weitere Zugehörige Personen. i have tried multiple formulas and have not yet found a solution. Please advise!
