Need a formla to count

levanoj

Active Member
Joined
Oct 25, 2007
Messages
311
I have a spreadsheet that appears as follows:
Book1
ABCD
1PhoneIDSpeakerModel
2200spk8
3200spk8
4200spk8
5200spk8
6200spk8
7200spk16
8201spk8
9201spk8
10201spk16
11201spk16
12202spk8
13202spk8
14202spk8
15202spk8
16203spk16
17203spk16
18204spk16
19204spk16
20204spk16
21204spk16
22204spk8
Sheet2


And on another worksheet I have a table that looks as follows:
Book1
ABCD
1PhoneIDspk8spk16
2200
3201
4202
5203
6204
Sheet1


What I'm looking for is a formula that I can enter in the blank spaces under column B & C that will count the number of appearnces the spkr8 or spkr16 value shows up for each of the phone ID's and provides a result as follows:

Book1
ABCD
1PhoneIDspk8spk16
220051
320122
420240
520302
620424
Sheet1


Make sense? Can anyone help?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Based on your example, place this formula in cell B2 and copy for all your cells in columns B and C:
Code:
=SUMPRODUCT(--(Sheet2!$A$2:$A$22=Sheet1!$A2),--(Sheet2!$B$2:$B$22=Sheet1!B$1))
 
Upvote 0
Thanks Joe4. That appears to have worked. I have a slight adjustment to the scenario below and am hoping that this is doable. Using my original example I have an additional column (C) that appears as follows:
Book2
ABCD
1PhoneIDSpeakerModelUserID
2200spk84010
3200spk8N/A
4200spk84034
5200spk84050
6200spk8N/A
7200spk16N/A
8201spk85001
9201spk83030
10201spk163550
11201spk16N/A
12202spk8N/A
13202spk8N/A
14202spk8N/A
15202spk84201
16203spk165454
17203spk165455
18204spk165899
19204spk165944
20204spk16N/A
21204spk16N/A
22204spk83021
Sheet2


What I'd like is to have a count formula that will only count the spk8 & spk16 values if there's a numeric value next to that cell in column C above. So using the example above the result would be as follows:

Book2
ABCD
1PhoneIDspk8spk16
220030
320121
420210
520302
620422
Sheet1
 
Upvote 0
Maybe this?
Code:
=SUMPRODUCT(--(Sheet2!$A$2:$A$22=Sheet1!$A2),--(Sheet2!$B$2:$B$22=Sheet1!C$1),--(Sheet2!$C$2:$C$22<>"N/A"))
 
Upvote 0
Maybe this?
Code:
=SUMPRODUCT(--(Sheet2!$A$2:$A$22=Sheet1!$A2),
--(Sheet2!$B$2:$B$22=Sheet1!C$1),
--(Sheet2!$C$2:$C$22<>"N/A"))

--ISNUMBER(Sheet2!$C$2:$C$22)

might be more appropriate instead of

--(Sheet2!$C$2:$C$22<>"N/A")
 
Upvote 0
--ISNUMBER(Sheet2!$C$2:$C$22)

might be more appropriate instead of

--(Sheet2!$C$2:$C$22<>"N/A")
Agreed. That is a better solution.
Code:
=SUMPRODUCT(--(Sheet2!$A$2:$A$22=Sheet1!$A2),--(Sheet2!$B$2:$B$22=Sheet1!B$1),--ISNUMBER(Sheet2!$C$2:$C$22))
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,135
Members
452,890
Latest member
Nikhil Ramesh

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