spooonmanz
New Member
- Joined
- Jun 13, 2013
- Messages
- 4
Hi,
Apologize in advance for I expect this has been asked before but after searching the posts, I was unable to find a solution.
I have a report where one column of cells contain multiple values separated by a comma. The values between each comma may vary in length of 7-8 char and the # of values in each cell may vary as well. What I desire to do is to identify the last value and depending on it's value, possibly the 2nd and or 3rd last values in the string.
For example,
Cell S1 may have: A10-00,A100-00,A200-00,A500-00,A500-10
Cell S2 may have: A10-00,A10-01,A500-02
Cell S15000 may have: A100-10,A200-00,A300-01,A300-02,A350-03,A400-00,A402-20,A500-00,A500-22,A500-30
There are possible scenarios of values I may be looking for but typically I'm looking for the last value in the string or 2nd to last and last value.
In a rare instance, I may be interested in the 3rd or 4th last values.
For example using the above example data,
in Cell S1, I would like to collect the last three values (A200-00,A500-00,A500-10)
in cell S2, want to collect the last 2 values of A10-01, A500-02
in cell s15000, want to collect A402-20,A500-00,A500-22,A500-30
I can expand the column with text-to-columns. The challenge is the column S data may have 2-3 values comma separated or 20-30 values that are comma separated in the same cell. There are fields to the left in columns A-R, and T-V. I don't see how expanding the values makes this better or worse. However, I'm open to any solution.
I've been stumped most of today. I found the following on the web (possibly in this forum, don't recall) and it returns the last value but unsure how to find the 2nd, 3rd or 4th last values.....
=RIGHT(S2,LEN(S2)-FIND(CHAR(1),SUBSTITUTE(S2,",",CHAR(1),LEN(S2)-LEN(SUBSTITUTE(S2,",",""))))
I inserted a column (T) to house the formula and then copy/paste down the table to find the last value.
I hope this makes sense. Short of adding a file which I can do if that would be helpful.
Thank you in advance for any and all assistance,
PE
Apologize in advance for I expect this has been asked before but after searching the posts, I was unable to find a solution.
I have a report where one column of cells contain multiple values separated by a comma. The values between each comma may vary in length of 7-8 char and the # of values in each cell may vary as well. What I desire to do is to identify the last value and depending on it's value, possibly the 2nd and or 3rd last values in the string.
For example,
Cell S1 may have: A10-00,A100-00,A200-00,A500-00,A500-10
Cell S2 may have: A10-00,A10-01,A500-02
Cell S15000 may have: A100-10,A200-00,A300-01,A300-02,A350-03,A400-00,A402-20,A500-00,A500-22,A500-30
There are possible scenarios of values I may be looking for but typically I'm looking for the last value in the string or 2nd to last and last value.
In a rare instance, I may be interested in the 3rd or 4th last values.
For example using the above example data,
in Cell S1, I would like to collect the last three values (A200-00,A500-00,A500-10)
in cell S2, want to collect the last 2 values of A10-01, A500-02
in cell s15000, want to collect A402-20,A500-00,A500-22,A500-30
I can expand the column with text-to-columns. The challenge is the column S data may have 2-3 values comma separated or 20-30 values that are comma separated in the same cell. There are fields to the left in columns A-R, and T-V. I don't see how expanding the values makes this better or worse. However, I'm open to any solution.
I've been stumped most of today. I found the following on the web (possibly in this forum, don't recall) and it returns the last value but unsure how to find the 2nd, 3rd or 4th last values.....
=RIGHT(S2,LEN(S2)-FIND(CHAR(1),SUBSTITUTE(S2,",",CHAR(1),LEN(S2)-LEN(SUBSTITUTE(S2,",",""))))
I inserted a column (T) to house the formula and then copy/paste down the table to find the last value.
I hope this makes sense. Short of adding a file which I can do if that would be helpful.
Thank you in advance for any and all assistance,
PE