Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Sun IF two data types are the same in a single column

Am sure their is an easy answer to this !! But am trying to count the number
of times the letter Q and S appear in the samE column.

The formulae to count Q which works is as below :-

{=SUM(IF(H$7:H$1300 = "Q",1,0))}

What I would like to write for Q and S is :-

{=SUM(IF(H$7:H$1300 = "Q" or "S",1,0))}

But it does not work !!!!!!!!!

Would really appreciate any help on this,
Thanks,
David.



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Sun IF two data types are the same in a single column

If you are counting the number of cells that contain either "Q" or "S", try
this:

=SUM(COUNTIF(H$7:H$1300,{"q","s"}))

Note: COUNTIF is NOT case sensitive

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"David_Williams_PG ()" wrote:

Am sure their is an easy answer to this !! But am trying to count the number
of times the letter Q and S appear in the samE column.

The formulae to count Q which works is as below :-

{=SUM(IF(H$7:H$1300 = "Q",1,0))}

What I would like to write for Q and S is :-

{=SUM(IF(H$7:H$1300 = "Q" or "S",1,0))}

But it does not work !!!!!!!!!

Would really appreciate any help on this,
Thanks,
David.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Sun IF two data types are the same in a single column

=sum(countif(H$7:H$1000="Q"),countif(H$7:H$1000)=" S")

This just counts the number of Q's and S's in the range and sums those two
values together. Should work for you.

Dave
--
Brevity is the soul of wit.


"David_Williams_PG ()" wrote:

Am sure their is an easy answer to this !! But am trying to count the number
of times the letter Q and S appear in the samE column.

The formulae to count Q which works is as below :-

{=SUM(IF(H$7:H$1300 = "Q",1,0))}

What I would like to write for Q and S is :-

{=SUM(IF(H$7:H$1300 = "Q" or "S",1,0))}

But it does not work !!!!!!!!!

Would really appreciate any help on this,
Thanks,
David.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Sun IF two data types are the same in a single column

BTW, if you do want to use an array formula, something like this would
address your "or" condition:

{=SUM(IF(OR(H$7:H$1300="Q",H$7:H$1300="S",1,0))}

Dave
--
Brevity is the soul of wit.


"David_Williams_PG ()" wrote:

Am sure their is an easy answer to this !! But am trying to count the number
of times the letter Q and S appear in the samE column.

The formulae to count Q which works is as below :-

{=SUM(IF(H$7:H$1300 = "Q",1,0))}

What I would like to write for Q and S is :-

{=SUM(IF(H$7:H$1300 = "Q" or "S",1,0))}

But it does not work !!!!!!!!!

Would really appreciate any help on this,
Thanks,
David.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Sun IF two data types are the same in a single column

=SUMPRODUCT(--(ISNUMBER(MATCH(H$7:H$1300,{"Q","S"},0))))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"David_Williams_PG" wrote in
message ...
Am sure their is an easy answer to this !! But am trying to count the

number
of times the letter Q and S appear in the samE column.

The formulae to count Q which works is as below :-

{=SUM(IF(H$7:H$1300 = "Q",1,0))}

What I would like to write for Q and S is :-

{=SUM(IF(H$7:H$1300 = "Q" or "S",1,0))}

But it does not work !!!!!!!!!

Would really appreciate any help on this,
Thanks,
David.







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
Inputting data to one worksheet for it effect another daedalus1 Excel Discussion (Misc queries) 1 June 25th 06 04:39 PM
Coverting data in a one column into a single row Vishnu Excel Discussion (Misc queries) 2 June 20th 06 10:09 PM
Viewing data from one column within one single cell ? MAC Excel Discussion (Misc queries) 3 February 22nd 06 05:29 PM
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM


All times are GMT +1. The time now is 10:49 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"