Multiple COUNTIF

BeeRainbow

New Member
Joined
Nov 1, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm trying to use multiple COUNTIF to check two sets of criteria.

I have a list of ID’s who have a specific fruit for each day of the week. What I need is for the ID and fruit columns to be compared, with the following criteria

If duplicate IDs are found and the same fruit on both days it should display ‘Same fruit’
If duplicate IDs are found but the fruits are different for the days then it should display ‘Different fruit’
If no duplicate IDs re found then the actual name of the fruit correlating with that ID should be displayed

My data contains three columns – Days (column A), ID (column B), Fruit (column C) and I’m using the following formula in column D

=IF(COUNTIF(B:B,B2)>1,"Same fruit", "Different fruit")

I tried to add further COUNTIF statement but it results in errors.

Fruit.jpg


Any help with this will be appreciated

Thank you
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(COUNTIFS(B:B,B2)=1,C2,IF(COUNTIFS(B:B,B2)=COUNTIFS(B:B,B2,C:C,C2),"same","Different"))
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(COUNTIFS(B:B,B2)=1,C2,IF(COUNTIFS(B:B,B2)=COUNTIFS(B:B,B2,C:C,C2),"same","Different"))
Oh wow! Thank you so much Fluff, it has worked :biggrin:
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,620
Latest member
dsubash

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