Formula for counting with two criteria, name and counting for baseball stats

elketa1252

New Member
Joined
May 19, 2017
Messages
16
Guys,

I have a baseball team and would like a formula to keep the stats. For example, I would like a formula in Cell F3 that counts how many 1b(from Cell F2) does Salvador Martinez(Cell B3) has in the range B33:F:40. So this formula would need to match B3 and find the rows where Salvador Martinez is and add all the 1b. The return would be 3, the ones in yellow. I would use the formula for the other players and for the different stats found in ranges F:2N2. Just to throw another example, these are in red for Jose Perez HR, Cell I7, this formula would return 2 here. Any help would be much appreciated. I have tried all types of formula, index match sumproduct and just cannot do it. Sorry for my english, it's my second language.

Thank you. And I tried upload a picture but it's asking me for an URL instead of uploading from my computer.


B C D E F G H I J K L M N O P Q R S
2 NamePAABH1b2b3bHRROESACfBBGDPKsRBIRUNSBAOB%Slug%
3 Salvador Martinez00000000000000#N/A#N/A#N/A
4 Miguel Rosario000000000000000.0000.0000.000
5 Frank Guzman000000000000000.0000.0000.000
6 Galindo Gomez000000000000000.0000.0000.000
7 Jose Perez000000000000000.0000.0000.000
33 Salvador Martinez2b1b2bhr
34 Yoel Martinez2bhr2b1b
35 Jose Perez2b1bhrhr
36 Miguel Rosariohr2b3b3b
37 Frank Guzman1b2b3b2b
38 Salvador Martinez3b2b3b3b
39 Galindo Gomez2b3b3b2b
40 Salvador Martinez2b1b1bhr

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
This?


Excel 2010
ABCDEFGHIJKLMNOPQR
1NamePAABH1b2b3bHRROESACfBBGDPKsRBIRUNSBAOB%Slug%
2Salvador Martinez00034320000000000
3Miguel Rosario00001210000000000
4Frank Guzman00012100000000000
5Galindo Gomez00002200000000000
6Jose Perez00011020000000000
7
8
9Salvador Martinez2b1b2bhr
10Yoel Martinez2bhr2b1b
11Jose Perez2b1bhrhr
12Miguel Rosariohr2b3b3b
13Frank Guzman1b2b3b2b
14Salvador Martinez3b2b3b3b
15Galindo Gomez2b3b3b2b
16Salvador Martinez2b1b1bhr
Sheet2
Cell Formulas
RangeFormula
B2=SUMPRODUCT(($A$9:$A$16=$A2)*($B$9:$E$16=B$1))
 
Upvote 0
Hey wow thank you very much but I can't get it to work. I am pretty sure that might be the solution because most of the solutions online i searched brought me to something like this but it doesn't work for me. Im using excel 2016. could that be it? This is the formula I pasted specifically in Cell F3 and it just doesn't work . =SUMPRODUCT(($B$33:$B$40=$B3)*($C$33:$F$40=F$2))

Do you have the file because all the results you got is exactly what I need.

Thank you again for all your help.
 
Upvote 0
Sorry I just realized your table is setup different than mine, the columns and rows, but the formula I pasted in my reply is in the right location in my file. Don't want to confuse you.
 
Upvote 0
your table is setup different than mine

This any better?


Excel 2010
BCDEFGHIJKLMNOPQRS
2NamePAABH1b2b3bHRROESACfBBGDPKsRBIRUNSBAOB%Slug%
3Salvador Martinez00034320000000000
4Miguel Rosario00001210000000000
5Frank Guzman00012100000000000
6Galindo Gomez00002200000000000
7Jose Perez00011020000000000
31
32
33Salvador Martinez2b1b2bhr
34Yoel Martinez2bhr2b1b
35Jose Perez2b1bhrhr
36Miguel Rosariohr2b3b3b
37Frank Guzman1b2b3b2b
38Salvador Martinez3b2b3b3b
39Galindo Gomez2b3b3b2b
40Salvador Martinez2b1b1bhr
Sheet2
Cell Formulas
RangeFormula
C3=SUMPRODUCT(($B$33:$B$40=$B3)*($C$33:$F$40=C$2))
 
Upvote 0
Sorry maybe I did not explain myself well. I have the formula and understand it, it's just that excel doesn't do the calculation, it just returns 0, it does not do the calculation for me. I tried it as an array formula too with ctrl shift and enter and nothing, it just returns 0. I even changed the locations of all the cells to match yours and copied and pasted the formula and nothing. It's a file done in a 1997-2003 excel format but Im using 2016 excel. Could that be it since Im pretty sure I have everything the right way.
 
Upvote 0
Have you checked to see if Calculation is set to manual or automatic?
 
Upvote 0
Be sure that you are dragging the formula in B2 across and down (using the 1st example provided).
 
Last edited:
Upvote 0
Have you checked to see if Calculation is set to manual or automatic?

Thanks for the reply. I just checked in the options > formulas and it's set to automatic. I'm sorry for the back and forth. It's supposed to be automatic I imagine right?
 
Upvote 0
Be sure that you are dragging the formula in B2 across and down (using the 1st example provided).

It's not when I'm dragging, it's just that the first formula doesn't even work. I have a little knowledge of excel and I know that $ is to lock the cell if that's what you mean. Once I get a cell to work I will know how to make it work every where but it doesn't even work on the first cell. Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

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