2 Under 2, 3 Under 3, 4 Under 4, Etc in Range with Blanks

rob51852

Board Regular
Joined
Jun 27, 2016
Messages
191
Office Version
  1. 2016
Platform
  1. Windows
Hello


I have a range of data in O5:O45 with some cells being blank.


Is it possible to come up with a formula that ignores and blank cells and looks for instances where there are 2 values under 2, 3 under 3, 4 under 4 and 5 under 5 and return a 2, 3, 4 or 5 as appropriate?


Thank you
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
1, 1, blank, 2,2,1,2,2,2,2 gives 2 under 2 in first 2, 3 under 3 in first 4 incl blank, 3 under 3 in first 5 etc

how do you want them marked, in another column, coloured ?
 
Upvote 0
Is it possible to come up with a formula that ignores and blank cells and looks for instances where there are 2 values under 2, 3 under 3, 4 under 4 and 5 under 5 and return a 2, 3, 4 or 5 as appropriate?

Hi, if I've correctly understood, here is one option you can try:

=INDEX({5,4,3,2},MATCH(TRUE,(COUNTIFS(O5:O45,{"<5","<4","<3","<2"})>{4,3,2,1}),0))
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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