sumproduct or countA, but how :)

zyuth

New Member
Joined
Sep 7, 2019
Messages
4
FruitsYears
apple2018
apple2018
orange2018
banana2018
peach2019
grape2019
apple2019
melon2019
20183

<colgroup><col span="2"></colgroup><tbody>
</tbody>

hi i got this case, can you help me out for the formula? as u can see the answer is 3, but when i change to 2019 the answer is 4. thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
What formula are you using to get this result, and what is the criteria for the calculation


Excel 2013/2016
AB
1FruitsYears
2apple2018
3apple2018
4orange2018
5banana2018
6peach2019
7grape2019
8apple2019
9melon2019
10
1120191
Sheet2
Cell Formulas
RangeFormula
B11=SUMPRODUCT(--(A2:A9="apple"),--(B2:B9=A11))
 
Last edited:
Upvote 0
oh.. you are too specific by putting apple on it. what i want is how much fruit type in 2018 (or base on year that i will put)
 
Upvote 0

Excel 2013/2016
AB
1FruitsYears
2apple2018
3apple2018
4orange2018
5banana2018
6peach2019
7grape2019
8apple2019
9melon2019
10
1120194
Sheet2
Cell Formulas
RangeFormula
B11=COUNTIF(B2:B9,A11)
 
Upvote 0
to be truth i like your first answer, cause right now is only count for year only. beside the answer should be (2018=3) and (2019=4)
 
Upvote 0
beside the answer should be (2018=3) and (2019=4)

Perhaps something like this?

B11 =SUMPRODUCT((B$2:B$9=$A11)/(COUNTIFS(B$2:B$9; B$2:B$9&""; A$2:A$9; A$2:A$9&"")+(B$2:B$9<>$A11)))
B12 =SUMPRODUCT((B$2:B$9=$A12)/(COUNTIFS(B$2:B$9; B$2:B$9&""; A$2:A$9; A$2:A$9&"")+(B$2:B$9<>$A12)))

A
B
1
Fruits
Years
2
apple​
2018​
3
apple​
2018​
4
orange​
2018​
5
banana​
2018​
6
peach​
2019​
7
grape​
2019​
8
apple​
2019​
9
melon​
2019​
10
11
2018​
3​
12
2019​
4​
Sheet: Sheet1
 
Upvote 0
Well, you'd probably get a better answer if you provided more information on what you require....
 
Upvote 0

Forum statistics

Threads
1,214,416
Messages
6,119,386
Members
448,891
Latest member
tpierce

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