How to count up elements in excel

前端 未结 3 1989
伪装坚强ぢ
伪装坚强ぢ 2021-01-25 17:42

So I have a column called chemical formula for like 40,000 entries, and what I want to be able to do is count up how many elements are contained in the chemical formula. So for

3条回答
  •  囚心锁ツ
    2021-01-25 18:13

    I've had a stab at doing this in a formula nad come up with the following:

    =IFERROR((MID($C18,FIND(D17,$C18)+1,2))*1,IFERROR((MID($C18,FIND(D17,$C18)+1,1))*1,IFERROR(IF(FIND(D17,$C18)>0,1),0)))
    

    It's not very neat and would have to be expanded further if any of your elements are going to appear more than 99 times - I also used a random placement on my worksheet so the titles H,C and O are in row 17. I would personally go with Jamie's answer but just wanted to try this to see if I could do it in a formula possible and figured it was worth sharing just as another perspective.

提交回复
热议问题