How to use if statement with comma separated value

2019-09-02 04:20发布

This is a follow up question for my previously asked question: Set cell value based on value in other cell

So basically I have a cell which value is based on value in another cell, which contains some text. Formula is:

=IF(ISTEXT([@[Right name]]); INDEX([Left UID]; MATCH([@[Right name]]; [Left name]; 0)); "")

Now I would like to do so that more than one inputs would be okay for the function, separated by commas. For example "word1, word2, word3" and the result of the function would be "1, 2, 3" in other cell, or whatever, depending of the cell value. Is there any way to do that in Excel?

I could achieve the same result if I just add another row, but then it mixes up my indexing system. Currently every row has a unique ID value which is based on row number and I don't want to have more of those IDs. I just want to add more information for one ID. I could manually remove the ID from those rows, but then it should have taken account on the other row values, so value would be row number minus empty rows in that column.

What is the best solution to overcome this problem?

EDIT: more concrete example added

My current situation is following:

enter image description here

I would like to have the following data format. So basically I want to add more information about any item to the same row.

enter image description here

If the previous method goes too complex, then one possible option is to use the following format. Actually this might be even better for readability. If that is the way to go, I would like to know how to formulate the column "LeftUID" so that I could automate the row numbering. Manual numbering is not an option since I'm dealing with a great amount of data and I need to insert new rows regularly.

enter image description here

0条回答
登录 后发表回答