I need to calculate the frequency of an element/number per line
The attached table explains it all!
I need to calculate the frequency of an element/number per line
The attached table explains it all!
What are the expected results?
Your picture asks for the number of "a"'s/the number of a's+b'sOriginally Posted by seether
=COUNTIF(A1:J1,"*a*")/(COUNTIF(A1:J1,"*a*")+COUNTIF(A1:J1,"*b*"))
Thanks Dave but it is giving me an error!
Look at the attached graphic
the expected results are frequencies:Originally Posted by daddylonglegs
if a line contains:
aa ab bb aa
then there are 5 "a" and 3 "b" the result would be: 3/5+3
Are you perhaps on a European version of Excel...where ; is used as argument separators instead of ,Originally Posted by seether
Please Login or Register to view this content.
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Yep excellent! That solved it Thanks a lot NBVC :thumbs up:Originally Posted by NBVC
Are you sure?Originally Posted by seether
COUNTIF won't count the number of "a"s and "b"s in a cell, it'll only count how many cells have "a" s or "b"s, e.g. for your above example
then you presumably want a result of 3/(3+5)=0.375?Originally Posted by seether
COUNTIF formula will give =2/(3+2)=0.4
To get 3.75, assuming cells only contain "a"s and "b"s as per your example
=SUMPRODUCT(LEN(A1:J1)-LEN(SUBSTITUTE(A1:J1;"b";"")))/SUMPRODUCT(LEN(A1:J1))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks