I have col X and col Y.
Col X has values with organisation name and col Y has values with the ultimate parent name of the corresponding organisation in col X. The values of Col Y are more important for me, but it has many missing values.
I would like to create a col Z, which would contain the values of col Y; but if there are missing values in col Y, then I would like col Z to contain the values of col X.
Edit: I have realised that my columns X and Y have unwanted spaces, which I would like to get rid of, before I create column Z.
Apparently, cols X and Y have cells with spaces only (e.g. 20 spaces). I would like to make these cells blank, so I could use the code provided by akrun below. Also, some of the useful text values (names of an organisation) end with two or more spaces, and I would like to get rid of these unwanted spaces as well.
An example of what I have and want to have, where "s" represents a space:
Apologies for posting a pic as an example (still can't figure out how to make a more comfy data table).
Thanks...