I have a CSV dataset that contains a series of rows each with a number of different data fields populated by having selecting from a series of pre-defined options. The name of each option across all the data fields is unique, so for example no two fields would contain "high" as an option but each one would have a name specific to that field.
The problems I have are that the same field is not always in the same position in every row, not every field is always populated in each row and there are spaces between the delimiter in the dataset and each data point. For example something like this (but with many more data fields):
Good quality | Low price | Good service | Poor location
High price | Poor service
Poor service | Medium price | Medium quality
I would like to format the dataset so that I can see each field in the same column on every row in a table (and show a blank if no option has been selected for that field in that row). I think I have a potential solution but it's not a good one - to do Text to Columns and then do a series of If / Countif statements in each column of a new table to get the data into the format I want, for example in the "Quality" column of the new table row 2 would look like:
=IF(COUNTIF($A2:$D2,"Good quality ")>0,"Good quality",IF(COUNTIF($A2:$D2,"Medium quality ")>0,"Medium quality",IF(COUNTIF($A2:$D2,"Poor quality ")>0,"Poor quality","")))
However I suppose I'd also need to add in the options where there was also a space at the beginning of the name (where it wasn't the first field in a row) and in any case for the size of the dataset I think it would just take too long to set up and assume there must be a better way. So I was hoping someone could help and suggest something better please? Many thanks in advance!
The problems I have are that the same field is not always in the same position in every row, not every field is always populated in each row and there are spaces between the delimiter in the dataset and each data point. For example something like this (but with many more data fields):
Good quality | Low price | Good service | Poor location
High price | Poor service
Poor service | Medium price | Medium quality
I would like to format the dataset so that I can see each field in the same column on every row in a table (and show a blank if no option has been selected for that field in that row). I think I have a potential solution but it's not a good one - to do Text to Columns and then do a series of If / Countif statements in each column of a new table to get the data into the format I want, for example in the "Quality" column of the new table row 2 would look like:
=IF(COUNTIF($A2:$D2,"Good quality ")>0,"Good quality",IF(COUNTIF($A2:$D2,"Medium quality ")>0,"Medium quality",IF(COUNTIF($A2:$D2,"Poor quality ")>0,"Poor quality","")))
However I suppose I'd also need to add in the options where there was also a space at the beginning of the name (where it wasn't the first field in a row) and in any case for the size of the dataset I think it would just take too long to set up and assume there must be a better way. So I was hoping someone could help and suggest something better please? Many thanks in advance!