Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Formula to count values in two columns

Microsoft Excel 2000:
Is it possible to count values from two columns. I know that to count
values from one column the formula is =COUNTIF(B2:B20,"NEW"), but I need to
count a value from a second column also. For example:
Column A Column B
NEW critical
NEW critical
CLOSED major
NEW major

I need a formula that will count the value for "NEW" in Column A that are
"critical" in Column B. The count for this example should be 2. The count
for NEW - major should be 1 and CLOSED - major should be 1. Can anyone help?
THANKS!!


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,047
Default Formula to count values in two columns

hi,

=sumproduct(--(a2:a1000="new")*(b2:B1000="critical"))

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"JBurlage" escreveu:

Microsoft Excel 2000:
Is it possible to count values from two columns. I know that to count
values from one column the formula is =COUNTIF(B2:B20,"NEW"), but I need to
count a value from a second column also. For example:
Column A Column B
NEW critical
NEW critical
CLOSED major
NEW major

I need a formula that will count the value for "NEW" in Column A that are
"critical" in Column B. The count for this example should be 2. The count
for NEW - major should be 1 and CLOSED - major should be 1. Can anyone help?
THANKS!!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Formula to count values in two columns

Marcelo - I tried it and it does not work. I get a count of 0.

"Marcelo" wrote:

hi,

=sumproduct(--(a2:a1000="new")*(b2:B1000="critical"))

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"JBurlage" escreveu:

Microsoft Excel 2000:
Is it possible to count values from two columns. I know that to count
values from one column the formula is =COUNTIF(B2:B20,"NEW"), but I need to
count a value from a second column also. For example:
Column A Column B
NEW critical
NEW critical
CLOSED major
NEW major

I need a formula that will count the value for "NEW" in Column A that are
"critical" in Column B. The count for this example should be 2. The count
for NEW - major should be 1 and CLOSED - major should be 1. Can anyone help?
THANKS!!


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,047
Default Formula to count values in two columns

hi,

strange, it works here, could you type your formula?

--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"JBurlage" escreveu:

Marcelo - I tried it and it does not work. I get a count of 0.

"Marcelo" wrote:

hi,

=sumproduct(--(a2:a1000="new")*(b2:B1000="critical"))

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"JBurlage" escreveu:

Microsoft Excel 2000:
Is it possible to count values from two columns. I know that to count
values from one column the formula is =COUNTIF(B2:B20,"NEW"), but I need to
count a value from a second column also. For example:
Column A Column B
NEW critical
NEW critical
CLOSED major
NEW major

I need a formula that will count the value for "NEW" in Column A that are
"critical" in Column B. The count for this example should be 2. The count
for NEW - major should be 1 and CLOSED - major should be 1. Can anyone help?
THANKS!!


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Formula to count values in two columns

Hi Marcelo - I did a copy and paste from this posting and it would not work,
so I typed it in and now it is working!! Thanks so much for your help. I
appreciate the time and effort you took to help me out.
Regards from Wisconsin (USA)

"Marcelo" wrote:

hi,

strange, it works here, could you type your formula?

--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"JBurlage" escreveu:

Marcelo - I tried it and it does not work. I get a count of 0.

"Marcelo" wrote:

hi,

=sumproduct(--(a2:a1000="new")*(b2:B1000="critical"))

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"JBurlage" escreveu:

Microsoft Excel 2000:
Is it possible to count values from two columns. I know that to count
values from one column the formula is =COUNTIF(B2:B20,"NEW"), but I need to
count a value from a second column also. For example:
Column A Column B
NEW critical
NEW critical
CLOSED major
NEW major

I need a formula that will count the value for "NEW" in Column A that are
"critical" in Column B. The count for this example should be 2. The count
for NEW - major should be 1 and CLOSED - major should be 1. Can anyone help?
THANKS!!




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default Formula to count values in two columns

You can use the following custom function to get your result:

Press ALT + F11 to open the VBE and then click INSERT on the menu and select
MODULE. You can copy and paste everthing from Function ... down to End
Function.

Using your example and assuming that the first row was row 1, the formula
would be entered =CountNewCrit(A1:B4)

Function CountNewCrit(CellAddress As Range) As Long


Dim r As Range
Dim l As Long
Dim lngRows As Long
Dim intCount As Integer

Set r = CellAddress
lngRows = r.Rows.Count

For l = 1 To lngRows
If Cells(l, 1) = "New" And _
Cells(l, 2) = "Critical" Then
intCount = intCount + 1
End If
Next l

Exit_Count:

Set r = Nothing
CountNewCrit = intCount
Exit Function

End Function


--
Kevin Backmann


"JBurlage" wrote:

Microsoft Excel 2000:
Is it possible to count values from two columns. I know that to count
values from one column the formula is =COUNTIF(B2:B20,"NEW"), but I need to
count a value from a second column also. For example:
Column A Column B
NEW critical
NEW critical
CLOSED major
NEW major

I need a formula that will count the value for "NEW" in Column A that are
"critical" in Column B. The count for this example should be 2. The count
for NEW - major should be 1 and CLOSED - major should be 1. Can anyone help?
THANKS!!


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Formula to count values in two columns

Insert column C...enter =concatenate(a1,"-",b1), drag down all rows...insert
column d...countif(a1:b4,c1)....run down all rows. Clean up repeats as
needed.

"JBurlage" wrote:

Microsoft Excel 2000:
Is it possible to count values from two columns. I know that to count
values from one column the formula is =COUNTIF(B2:B20,"NEW"), but I need to
count a value from a second column also. For example:
Column A Column B
NEW critical
NEW critical
CLOSED major
NEW major

I need a formula that will count the value for "NEW" in Column A that are
"critical" in Column B. The count for this example should be 2. The count
for NEW - major should be 1 and CLOSED - major should be 1. Can anyone help?
THANKS!!


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
How to Search, Count, Match and Post Values vincentws Excel Worksheet Functions 4 August 17th 06 05:20 PM
Need formula to count spinoffs jamescarvin Excel Worksheet Functions 1 July 14th 06 04:07 PM
Count number of times two columns have desired values Gavin Deveau Excel Discussion (Misc queries) 2 June 16th 06 06:29 PM
I would like to Count values in two columns. Roni Excel Worksheet Functions 6 June 5th 06 03:23 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM


All times are GMT +1. The time now is 07:21 PM.

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"