LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 563
Default using CountIF function or Array?

Why do you say that
COUNTIF(Sheet1!AG:AG,"600-KRF5792S")+COUNTIF(Sheet1!AG:AG,"600-KRF5899S")
"counts TWO columns " It counts how many time the two text values occur in
the single column AG.

You need SUMPRODUCT
COUNTIF(Sheet1!AG:AG,"600-KRF5792S")+COUNTIF(Sheet1!AG:AG,"600-KRF5899S")
could be replaced by
SUMPRODUCT( (Sheet1!AG:AG="600-KRF5792S")+(Sheet1!AG:AG,"600-KRF5899S"))
or
SUMPRODUCT( --(Sheet1!AG:AG={"600-KRF5792S","600-KRF5899S"}))
NOTE: you can use full column references only in Excel 2007+; in earlier
versions
SUMPRODUCT( --(Sheet1!AG1:AG1000={"600-KRF5792S","600-KRF5899S"}))

To add another condition
SUMPRODUCT( --(Sheet1!AG1:AG1000={"600-KRF5792S","600-KRF5899S"}),--(Sheet1!AM1:AM1000="silk
ties") )

For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html
Debra Dalgleish
http://www.contextures.com/xlFunctio...tml#SumProduct
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"AJ" wrote in message
...
I am trying to count two columns IF a 3rd colum equals a certain text.


This function will count the two columns just fine:

=COUNTIF(Sheet1!AG:AG,"600-KRF5792S")+COUNTIF(Sheet1!AG:AG,"600-KRF5899S")

but when I try to say I only want to count those two columns IF the third
column equals a7 i get a formula error. Im counting columns in Sheet 1
and
puting the totals on Sheet 2.

=COUNTIF(Sheet1!AG:AG,"600-KRF5792S")+COUNTIF(Sheet1!AG:AG,"600-KRF5899S"),COUNTIF(Sheet1!AC:AC,!A7)

So, my question is can i do a conditional Count or should I use an array
of
some sort to figure it out?


 
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
ARRAY with countif MCC Excel Discussion (Misc queries) 6 July 22nd 09 06:13 PM
Countif in an ARRAY. SW Excel Worksheet Functions 2 June 30th 08 04:54 AM
array and countif help! jcorle Excel Worksheet Functions 7 February 28th 08 03:39 PM
Countif array function not working ub Excel Worksheet Functions 5 September 26th 07 03:39 PM
countif within array Grant Excel Worksheet Functions 3 October 26th 06 07:58 AM


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