Count Lookup

IvanYerk

Board Regular
Joined
Aug 26, 2018
Messages
61
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I want to take the input cells, lookup their color values, then count the color occurrences. Probably need to use array but it's my achilles heel. Thanks!!

ABCDEFGH
INPUTFRUITCOLORCount
APPLEAPPLEREDORANGE ??
BANANAPEACHORANGERED
GRAPEGRAPEBLUEGREEN
MELONBERRYBLUEBLUE
MELONMELONGREENYELLOW
KIWIKIWIGREEN
BANANABANANAYELLOW
ORANGEORANGEORANGE
MANGOMANGOORANGE
STRAWSTRAWRED

<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Thanks for the reply, this is my first post so greatly appreciated. Not sure if the answer changes if I add FRUITS.

It appears with your solution, all ranges have to be equal or else I get #N/A.

=SUMPRODUCT(($A$2:$A$11=$C$2:$C$15)*($D$2:$D$15=F2))

So since I have a defined Input range, is there a way to make the formula more dynamic so I don't have to expand the Input range to include blank cells, i.e. A2:A15. Hope this makes sense. Thanks again!!

For example:


ABCDEFG
INPUTFRUITCOLORCount
APPLEAPPLEREDORANGE
BANANAPEACHORANGERED
GRAPEGRAPEBLUEGREEN
MELONBERRYBLUEBLUE
MELONMELONGREENYELLOW
KIWIKIWIGREEN
BANANABANANAYELLOW
ORANGEORANGEORANGE
MANGOMANGOORANGE
STRAWSTRAWRED
PASSIONRED
RASPERRYRED
PLUMBLUE

<colgroup><col span="2"><col><col span="4"></colgroup><tbody>
</tbody>
 
Upvote 0
A
B
C
D
E
F
G
1
INPUTFRUITCOLORCount
2
APPLEAPPLEREDORANGE
2​
3
BANANAPEACHORANGERED
2​
4
GRAPEGRAPEBLUEGREEN
2​
5
MELONBERRYBLUEBLUE
1​
6
MELONMELONGREENYELLOW
1​
7
KIWIKIWIGREEN
8
BANANABANANAYELLOW
9
ORANGEORANGEORANGE
10
MANGOMANGOORANGE
11
STRAWSTRAWRED
12
PASSIONRED
13
RASPERRYRED
14
PLUMBLUE

<tbody>
</tbody>


G2=
SUMPRODUCT((ISNUMBER(MATCH($C$2:$C$14,$A$2:$A$11,0)))*(ISNUMBER(MATCH($D$2:$D$14,F2,0)))) copy down
 
Upvote 0
Welcome to the MrExcel board!

Note that you can simplify the last part of that formula
=SUMPRODUCT((ISNUMBER(MATCH($C$2:$C$14,$A$2:$A$11,0)))*($D$2:$D$14=F2))
 
Upvote 0

Forum statistics

Threads
1,215,492
Messages
6,125,115
Members
449,206
Latest member
burgsrus

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