Associate
- Joined
- 31 Dec 2002
- Posts
- 458
Hi,
Is there a way to count the number of times for example the word "Yes" appears in an array, where you are only checking specific items in the array?
I can do a for loop which works, but this would only count the total number of occurrences in the array. My array has 24 items. i.e.
for i = 0 to 23
if array(i) = "Yes" then
total += 1
end if
next
what I am trying to do though is only check for example array items 1, 3, 6, 9 and 10 to see if they contain the text "Yes" and then assign the total to the variable total.
The reason for this is because I have a list of questions and have three categories of answers. Each category counts 'Yes' answers to specific questions i.e. category one applies if 1,4,6,7 answer 'Yes', category two applies if 8,10,11 answer 'Yes' and so on.
Thanks in advance. I have spent hours racking my brain over this!!!!!
Is there a way to count the number of times for example the word "Yes" appears in an array, where you are only checking specific items in the array?
I can do a for loop which works, but this would only count the total number of occurrences in the array. My array has 24 items. i.e.
for i = 0 to 23
if array(i) = "Yes" then
total += 1
end if
next
what I am trying to do though is only check for example array items 1, 3, 6, 9 and 10 to see if they contain the text "Yes" and then assign the total to the variable total.
The reason for this is because I have a list of questions and have three categories of answers. Each category counts 'Yes' answers to specific questions i.e. category one applies if 1,4,6,7 answer 'Yes', category two applies if 8,10,11 answer 'Yes' and so on.
Thanks in advance. I have spent hours racking my brain over this!!!!!