Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default And/Countif formula

I have a range of data which looks like something like this:-

london -2
london -2
london -1
wales -2

I am trying to create a formula that counts the number of times the first
column contains -1 and the second column contains -2, so far I have come up
with the formula:-

=SUM(IF(AND($B$4:$B$11="london",$C$4:$C$11=-2),1,0))

But this only returns a value of 1, can you help?




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,886
Default And/Countif formula

Hi

This needs to be entered as an array formula so commit with
Ctrl+Shift+Enter.
Excel will include the curly braces { } when you do this. Do not type
them yourself.
{=SUM(IF(AND($B$4:$B$11="london",$C$4:$C$11=-2),1,0))}

for a non-array solution you could use
=SUMPRODUCT(--($B$4:$B$11="london"),--($C$4:$C$11=-2))


--
Regards

Roger Govier


"nir020" wrote in message
...
I have a range of data which looks like something like this:-

london -2
london -2
london -1
wales -2

I am trying to create a formula that counts the number of times the
first
column contains -1 and the second column contains -2, so far I have
come up
with the formula:-

=SUM(IF(AND($B$4:$B$11="london",$C$4:$C$11=-2),1,0))

But this only returns a value of 1, can you help?






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 FORMULA ISSUES - NEED FORMULA CORRECTED Debbi Excel Worksheet Functions 2 November 18th 09 04:47 AM
Formula Help (countif, I think....) RUSH2CROCHET Excel Discussion (Misc queries) 2 June 6th 08 10:14 PM
CountIf formula results in the formula itself being displayed. NewKid Excel Worksheet Functions 9 December 21st 05 11:10 PM
Help with CountIF formula Smonczka Excel Programming 3 November 17th 05 10:49 PM
Another Countif Formula Stephen Excel Discussion (Misc queries) 3 April 22nd 05 04:29 PM


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