A sum of elements divided by the number of elements is a MEAN.
So this code:
sum_checking=sum(checking1,checking2,checking3,checking4,checking5,checking6,checking7);
count_word=countw(CLEANED_BY_WORD);
percent=sum_checking/count_word;
Assuming that "cleaned_by_word" matches the number of checking values then perhaps could be replaced with
percent_sum = mean(checking1, checking2, checking3, checking4,checking5, checking6, checking7);
I am a bit leery of this code:
if percent=0.8 then modifed_name=clean_by_word2;
if percent=0.75
because with 7 elements I would not expect to get 0.8 of 0.75 for any division by 7. 7* 0.8 = 5.6, 7*0.75 =5.25.
There are similar issues with most of the possible counts. I suspect that you maybe should be checking a range of values for percent but without any actual data and desired outcome this is a bit difficult to verify.
... View more