Counting certain text in a selection

28creation

Board Regular
Joined
Oct 13, 2014
Messages
124
Hi all,


I've got this code, & it's not bringing back the results I'm after.

=(IF(OR(COUNTIF(K7:M28,"No - Major")>0,1,COUNTIF(K7:M28,"No - Minor")>2,2),""))


K7-M28 are the cells (columns K, L & M are merged cells on each row).

Basically if any of these cells have a "No - Major" in them then the result in K29 should be 1, but if any have "No - Minor" three times or more than this should result in a 2.


Hope you can help!

Thanks.
 
We're getting there! Try:
Code:
=IF(COUNTIF(K7:M28,"No - Major"),1,IFERROR(LOOKUP(COUNTIF(K7:M28,"No - Minor"),{1,2,3},{2,2,1}),3))
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
That's great. Nearly there!

I need the result cell to stay blank if there's nothing in the selected cells.

Thanks!
 
Upvote 0
Try:
Code:
=IF(COUNTA(K7:M28)=0,"",IF(COUNTIF(K7:M28,"No - Major"),1,IFERROR(LOOKUP(COUNTIF(K7:M28,"No - Minor"),{1,2,3},{2,2,1}),3)))
 
Upvote 0

Forum statistics

Threads
1,216,212
Messages
6,129,531
Members
449,515
Latest member
lukaderanged

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