
Originally Posted by
SteveG
This will work for this one cell but it's a lot of maintenance if you have the need to sum the same type of data in A2, A3 and A4.
=SUM(VALUE(MID(A1,FIND("(",A1,1)+1,2))+VALUE(MID(A1,FIND("R",A1,1)+FIND("(",A1,1)-2,FIND(")",A1,1)-7))+VALUE(MID(A1,FIND("B",A1,1)+5,FIND(")",A1,1)-7))+VALUE(MID(A1,FIND("O",A1,1)+7,FIND("(",A1,1)-3)))
You can't just copy this down. If you have data in A2, A3 and so on that you wish to perform this function on, the data has to be identical meaning in A2 it needs to be in the same order (Green,Red,Blue,Orange) and have the same type of numeric value i.e. Orange always needs to be in the hundreds, the others always have to be 2 digits. If your data is not identical say in A2the first line = Green(116). You have increased the number of characters by 1 so all of the formulas above need to be adjusted so it would look like.
=SUM(VALUE(MID(A3,FIND("(",A3,1)+1,3))+VALUE(MID(A3,FIND("R",A3,1)+FIND("(",A3,1)-2,FIND(")",A3,1)-8))+VALUE(MID(A3,FIND("B",A3,1)+5,FIND(")",A3,1)-8))+VALUE(MID(A3,FIND("O",A3,1)+7,FIND("(",A3,1)-4)))
Notice the last number that you are adding to the FIND function in each is increased by 1.
If Blue changes to 3 characters, you only have to change from the 3rd formula on.
In any event, like I said, it's a lot of maintenance.
HTH
Steve
Bookmarks