help with counting text in multiple columns?

krasp

New Member
Joined
Oct 3, 2006
Messages
9
Hello!! I am a newbie so I have to get out the usual thank the lord for the board and its users, etc. So...

I have text in clumns A and B but only want to count certain entries in A based on the entry in B.. Detailed question after the html code...

Thanks in advance!! :D
Book1.xls
ABCDEF
1AGENTORDERSOURCECOPLETEDSOURCETOTALDAVE
2MIKEDIAMONDYESDIAMOND3#VALUE!
3DAVEDIAMONDYESCLAY2
4JIMMILLERNOMILLER4
5MIKECLAYYESTOTALS9
6MIKEDIAMONDYES
7JIMMILLERNOCOMPLETED6
8JIMMILLERYESNOTCOMPLETE3
9JIMCLAYNO
10APRILMILLERYES
needtextcountingformulas


I need a formula to count how many times DAVE received an order from DIAMOND.
I assumed something like =COUNT(B:B,"DIAMOND")*IF(A:A,DAVE) but that doesn’t work
ALSO
I need a formula to count how many times DAVE received an order from DIAMOND that were 'completed'.
 
Aladin, Also,
How would I write this formula if I am writing the formula on sheet2 and the data is on sheet1?

THANKS!!
Chris :D
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
pgc, I don't have sapces after the entries. Thank you for showing me an alternative counting method!! :D

Aladin, Can you use that same formula to also use coulmn C as criteria (only count A:A if MIKE, if B:B is DIAMOND and C:C is YES

I just jumped seeing you in trouble with constants in the formulas...

Here is a fuller exhibit...
Book2
ABCDEFGHI
1AGENT
2AGENTORDER SOURCECOPLETEDSOURCETotalMIKEDAVEJIMAPRIL
3MIKEDIAMONDYESDIAMOND32100
4DAVEDIAMONDYESCLAY21010
5JIMMILLERNOMILLER40031
6MIKECLAYYESTotal93141
7MIKEDIAMONDYES
8JIMMILLERNOCOMPLETED63111
9JIMMILLERYESNOT COMPLETE30030
10JIMCLAYNO
11APRILMILLERYES
12
needtextcountingformulas


E3, copied down to E5:

=COUNTIF($B$3:$B$11,D3)

E6:

=SUM(E3:E5)

E8:

=COUNTIF($C$3:$C$11,"Yes")

E9:

=COUNTIF($C$3:$C$11,"No")

F3, copied across to I3 and down to row 5...

=SUMPRODUCT(--($A$3:$A$11=F$2),--($B$3:$B$11=$D3))

F6, copied across to I6:

=SUM(F3:F5)

F8, copied across to I8:

=SUMPRODUCT(--($A$3:$A$11=F$2),--($C$3:$C$11="Yes"))

F9, copied across to I9:

=SUMPRODUCT(--($A$3:$A$11=F$2),--($C$3:$C$11="No"))
 
Upvote 0
Aladin, Also,
How would I write this formula if I am writing the formula on sheet2 and the data is on sheet1?

THANKS!!
Chris :D

Just prefix the ranges with the sheet name, e.g.,

$A$3:$A$11 ===> Sheet1!$A$3:$A$11
 
Upvote 0
F8, copied across to I8:

=SUMPRODUCT(--($A$3:$A$11=F$2),--($C$3:$C$11="Yes"))

F9, copied across to I9:

=SUMPRODUCT(--($A$3:$A$11=F$2),--($C$3:$C$11="No"))


I can't get these to work when i replicate them in my own sheet. They always add up to 0 ...??
 
Upvote 0
F8, copied across to I8:

=SUMPRODUCT(--($A$3:$A$11=F$2),--($C$3:$C$11="Yes"))

F9, copied across to I9:

=SUMPRODUCT(--($A$3:$A$11=F$2),--($C$3:$C$11="No"))


I can't get these to work when i replicate them in my own sheet. They always add up to 0 ...??

A few things to check...

Have you added the sheet prefix to the ranges?

Does F$2 refer to a name as is the case in the exhibit?
 
Upvote 0
Hi,

Your data..
Book2
ABCD
1AGENTORDER SOURCECOPLETED
2MIKEDIAMONDYES
3DAVEDIAMONDYES
4JIMMILLERNO
5MIKECLAYYES
6MIKEDIAMONDYES
7JIMMILLERNO
8JIMMILLERYES
9JIMCLAYNO
10APRILMILLERYES
Sheet1


Result sheet...
Book2
ABCD
1AGENTORDER SOURCECOPLETED
29
3
4
59DIAMONDMILLERCLAY
6MIKE201
7DAVE100
8JIM031
9APRIL010
Sheet2


Define Database,

Refers to box: =Sheet1!$A$1:$C$10

A5 on Sheet2,

=DCOUNTA(Database,1,A1:C2)

Select A5:D9

Go to Data > Table >

Row Input Cell: B2
Column input cell: A2

Ok

If you want a particular result type the appropriate source, status in B2 and C2 respectively.

HTH
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top