kevinonearth
Member
Hi,
A friend of mine has passed on a problem to me
He has a massive survey spreadsheet, one of the questions people responded to was:
What is the reason for hospital closure? There are 15 possible answers, numbered 1 to 15
So users typed in 1 for the answer
But there may have been more then one reason
So in some cells users have typed 1,4,7,10,11 for example or 1 4 6 2 12
What I want to do is count the reasons
I have used this function to count the occurences of 1:
=LEN(A1)-LEN(SUBSTITUTE(A1,"1",""))
If cell A1 contains: 1, 4, 7,
then the above function will return 1
But if cell A1 contains 1, 4, 7, 10, 13
then the above function will return: 3
which of course is incorrect, it counts the ones in 1, 10 and 13
how do I correct this?
PS I am aware that this problem should not arise in the first place if the spreadhseet was designed correctly, but the problem is there now and needs solving! Thank you
A friend of mine has passed on a problem to me
He has a massive survey spreadsheet, one of the questions people responded to was:
What is the reason for hospital closure? There are 15 possible answers, numbered 1 to 15
So users typed in 1 for the answer
But there may have been more then one reason
So in some cells users have typed 1,4,7,10,11 for example or 1 4 6 2 12
What I want to do is count the reasons
I have used this function to count the occurences of 1:
=LEN(A1)-LEN(SUBSTITUTE(A1,"1",""))
If cell A1 contains: 1, 4, 7,
then the above function will return 1
But if cell A1 contains 1, 4, 7, 10, 13
then the above function will return: 3
which of course is incorrect, it counts the ones in 1, 10 and 13
how do I correct this?
PS I am aware that this problem should not arise in the first place if the spreadhseet was designed correctly, but the problem is there now and needs solving! Thank you