Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default COUNTIF function query

I have a spreadsheet with some survey results on it. As I want the results to
be assigned to the person completing the survey, I have several entries in
one cell where there has been a multiple choice question. I have put each
answer on a separate line so it's clear there were multiple answers.

I am now trying to COUNTIF each multiple choice option to see which was the
most popular, however my sum seems unable to count answers that are not top
of the cell. Is it possible to create a sum which can count the options
anywhere in the cell?

I have tried putting a * before the criteria and that brought back slightly
better results but still missed some cells.

If you need any further information please holler.

Thanks,

Wendy


Example:

A B
1 John Smith Email marketing
Hard copy marketing
Promotional gifts
2 Bob Smith Hard copy marketing
etc.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default COUNTIF function query

I have tried putting a * before the criteria and that brought back slightly
better results but still missed some cells.


Not sure whether you tried: =COUNTIF(B:B,"*"&D2&"*")
where D2 contains the text, eg: Hard copy marketing
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default COUNTIF function query

ohmygod, of course - what an idiot. I didn't try the wildcard at the other
end as well! It's working perfectly now, thank you Max!

"Max" wrote:

I have tried putting a * before the criteria and that brought back slightly
better results but still missed some cells.


Not sure whether you tried: =COUNTIF(B:B,"*"&D2&"*")
where D2 contains the text, eg: Hard copy marketing
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default COUNTIF function query

no prob, you're welcome.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"Wendy-Bob" wrote in message
...
ohmygod, of course - what an idiot. I didn't try the wildcard at the other
end as well! It's working perfectly now, thank you Max!



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 527
Default COUNTIF function query

Assuming that you have entered ALT+ENTER in B1 so that B1 contains Email
marketing, Hard copy marketing, Promotional gifts try a couple of helper
columns.

C1: =IF(LEN(B1)=0,"",LEN(B1)-LEN(SUBSTITUTE(B1,CHAR(10),""))+1)
and copy down gives you the number of duties in the cell.

In D1 enter the Array formula:
=IF(ROWS($1:1)<=SUM((A$2:A$294<"")/COUNTIF(A$2:A$294,A$2:A$294&"")),INDEX(A$2:A$294,S MALL(IF(A$2:A$294<"",IF(ROW(A$2:A$294)-MIN(ROW(A$2:A$294))+1=MATCH(A$2:A$294,A$2:A$294,0) ,ROW(A$2:A$294)-MIN(ROW(A$2:A$294))+1)),ROWS($1:1))),"")

Array formulas are enter CSE (Ctrl + Shift + Enter) copy down until you get
a blank cell.
This gives the list of names in Ascending order (assuming that they have
been duplicated)

The totals in E1 given by the formula:
=SUMPRODUCT(--($A$1:$A$200=D1),($C$1:$C$200))

copy down

regards
Peter Atherton

"Wendy-Bob" wrote:

I have a spreadsheet with some survey results on it. As I want the results to
be assigned to the person completing the survey, I have several entries in
one cell where there has been a multiple choice question. I have put each
answer on a separate line so it's clear there were multiple answers.

I am now trying to COUNTIF each multiple choice option to see which was the
most popular, however my sum seems unable to count answers that are not top
of the cell. Is it possible to create a sum which can count the options
anywhere in the cell?

I have tried putting a * before the criteria and that brought back slightly
better results but still missed some cells.

If you need any further information please holler.

Thanks,

Wendy


Example:

A B
1 John Smith Email marketing
Hard copy marketing
Promotional gifts
2 Bob Smith Hard copy marketing
etc.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default COUNTIF function query

Thanks Peter, that's really helpful (and way above anything I could ever have
worked out)!

The C1 formula that gives the number of duties in a cell; does that count
the number of seperate lines within a cell or can it count other multiples as
well (ie. separated by a comma instead)?

Thanks,

Wendy

"Billy Liddel" wrote:

Assuming that you have entered ALT+ENTER in B1 so that B1 contains Email
marketing, Hard copy marketing, Promotional gifts try a couple of helper
columns.

C1: =IF(LEN(B1)=0,"",LEN(B1)-LEN(SUBSTITUTE(B1,CHAR(10),""))+1)
and copy down gives you the number of duties in the cell.

In D1 enter the Array formula:
=IF(ROWS($1:1)<=SUM((A$2:A$294<"")/COUNTIF(A$2:A$294,A$2:A$294&"")),INDEX(A$2:A$294,S MALL(IF(A$2:A$294<"",IF(ROW(A$2:A$294)-MIN(ROW(A$2:A$294))+1=MATCH(A$2:A$294,A$2:A$294,0) ,ROW(A$2:A$294)-MIN(ROW(A$2:A$294))+1)),ROWS($1:1))),"")

Array formulas are enter CSE (Ctrl + Shift + Enter) copy down until you get
a blank cell.
This gives the list of names in Ascending order (assuming that they have
been duplicated)

The totals in E1 given by the formula:
=SUMPRODUCT(--($A$1:$A$200=D1),($C$1:$C$200))

copy down

regards
Peter Atherton

"Wendy-Bob" wrote:

I have a spreadsheet with some survey results on it. As I want the results to
be assigned to the person completing the survey, I have several entries in
one cell where there has been a multiple choice question. I have put each
answer on a separate line so it's clear there were multiple answers.

I am now trying to COUNTIF each multiple choice option to see which was the
most popular, however my sum seems unable to count answers that are not top
of the cell. Is it possible to create a sum which can count the options
anywhere in the cell?

I have tried putting a * before the criteria and that brought back slightly
better results but still missed some cells.

If you need any further information please holler.

Thanks,

Wendy


Example:

A B
1 John Smith Email marketing
Hard copy marketing
Promotional gifts
2 Bob Smith Hard copy marketing
etc.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 527
Default COUNTIF function query

You can change the substitute formula to look for a comma.

e.g C1: =IF(LEN(B1)=0,"",LEN(B1)-LEN(SUBSTITUTE(B1,",",""))+1)

Peter

"Wendy-Bob" wrote:

Thanks Peter, that's really helpful (and way above anything I could ever have
worked out)!

The C1 formula that gives the number of duties in a cell; does that count
the number of seperate lines within a cell or can it count other multiples as
well (ie. separated by a comma instead)?

Thanks,

Wendy

"Billy Liddel" wrote:

Assuming that you have entered ALT+ENTER in B1 so that B1 contains Email
marketing, Hard copy marketing, Promotional gifts try a couple of helper
columns.

C1: =IF(LEN(B1)=0,"",LEN(B1)-LEN(SUBSTITUTE(B1,CHAR(10),""))+1)
and copy down gives you the number of duties in the cell.

In D1 enter the Array formula:
=IF(ROWS($1:1)<=SUM((A$2:A$294<"")/COUNTIF(A$2:A$294,A$2:A$294&"")),INDEX(A$2:A$294,S MALL(IF(A$2:A$294<"",IF(ROW(A$2:A$294)-MIN(ROW(A$2:A$294))+1=MATCH(A$2:A$294,A$2:A$294,0) ,ROW(A$2:A$294)-MIN(ROW(A$2:A$294))+1)),ROWS($1:1))),"")

Array formulas are enter CSE (Ctrl + Shift + Enter) copy down until you get
a blank cell.
This gives the list of names in Ascending order (assuming that they have
been duplicated)

The totals in E1 given by the formula:
=SUMPRODUCT(--($A$1:$A$200=D1),($C$1:$C$200))

copy down

regards
Peter Atherton

"Wendy-Bob" wrote:

I have a spreadsheet with some survey results on it. As I want the results to
be assigned to the person completing the survey, I have several entries in
one cell where there has been a multiple choice question. I have put each
answer on a separate line so it's clear there were multiple answers.

I am now trying to COUNTIF each multiple choice option to see which was the
most popular, however my sum seems unable to count answers that are not top
of the cell. Is it possible to create a sum which can count the options
anywhere in the cell?

I have tried putting a * before the criteria and that brought back slightly
better results but still missed some cells.

If you need any further information please holler.

Thanks,

Wendy


Example:

A B
1 John Smith Email marketing
Hard copy marketing
Promotional gifts
2 Bob Smith Hard copy marketing
etc.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif Query John Moore Excel Discussion (Misc queries) 4 June 25th 07 10:06 PM
COUNTIF function query for multiple colums Malcolm Gordon Excel Worksheet Functions 5 April 10th 06 08:10 AM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
Embed a countif function in subtotal function? Stuck at work Excel Worksheet Functions 1 February 14th 06 03:19 AM
Microsoft Query rejects "nz" function in Access Query Vaughan Excel Discussion (Misc queries) 0 May 4th 05 05:20 PM


All times are GMT +1. The time now is 05:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"