Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Counting literals in cells

I'm trying to figure a quick way using a macro to count the results of
a survey recorded in an Excel spreadsheet. Each record in the survey
has cells that may contain "Yes", "No", "Maybe", "Sometimes" and
"Occasionally". Is there a macro that can count occurrences of each
literal and report their totals?

Thanks,

Joeyej
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Counting literals in cells

Hi Joeyei,

In excel you can use the CountIf worksheet function:

=CountIf(A1:A100,"Yes")

If you need to do this in code:

Dim Var As Long

Var = Application.CountIf(Range("A1:A100"), "Yes")

---
Regards,
Norman



"Joeyej" wrote in message
om...
I'm trying to figure a quick way using a macro to count the results of
a survey recorded in an Excel spreadsheet. Each record in the survey
has cells that may contain "Yes", "No", "Maybe", "Sometimes" and
"Occasionally". Is there a macro that can count occurrences of each
literal and report their totals?

Thanks,

Joeyej



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
counting cells that are 0 in a range of non-contiguous cells Mark Excel Worksheet Functions 9 March 14th 07 02:45 PM
Query counting cells in a row that exactly match cells in another Marlsnz Excel Discussion (Misc queries) 1 June 2nd 06 07:08 AM
linked cells change to literals Seamus Excel Discussion (Misc queries) 1 May 4th 06 07:31 PM
Complicated counting of cells (based on other cells contents) George Excel Worksheet Functions 3 November 7th 05 06:39 PM
Copy a cell value and add literals no_junk_mail Excel Worksheet Functions 2 September 6th 05 10:47 PM


All times are GMT +1. The time now is 06:45 PM.

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

About Us

"It's about Microsoft Excel"