Find if based on selected criteria

nostradamus

Board Regular
Joined
Aug 9, 2010
Messages
143
Office Version
  1. 365
Platform
  1. Windows
Hello all,

Have four formula requests based on certain criteria from the following dataset (using Office 365).
Formulas for Cells E2 - E5, for Low category ("1):
Cell E 2: Total count of "1" in range (B2:B14), if not, return 0
Cell E 3: Max value from Col A associated with "1" from Col B in range (A1:A14)
Cell E 4: Max continuous count of "1" in range (B2:B14), if not, return 0
Cell E 5: Max value from Col A associated with "1" from Col B in range (A1:A14) - only from the continuous count

Similar formulas in Cells E7 - E10, but with the Medium category ("2").

Hope formulas in E3 and E5 make sense, I could have worded it better ...
Thanks!!!

Copy of Colorado at Bastrop 1985-2021.xls
ABCDE
1QuantityCategoryVariableFormula Values
26251Low-Count7
36161Low-maxQtyForLow1030
45781Low-continuous count5
55711Low-maxQtyForContinuousCount625
65711
760302Medium-Count6
824302Medium-maxQtyForMedium6030
910301Medium-continuous count4
109201Medium-maxQtyForContinuousCount2920
1129202
1227502
1326902
1425402
15
16
Sheet2
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I came with a formula for
E2 = COUNTIF(B2:B14,"=1")
E4 =MAX(FREQUENCY(IF(B2:B14=1,ROW(B2:B14)),IF(B2:B14<>1,ROW(B2:B22))))

Can someone please check it, and also help with the other formulas.
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Count continuous instances and get max value from corresponding column
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Both those formulae look fine, other than you have different sized ranges in the E4 formula. For E3 you can use
Excel Formula:
=MAXIFS(A:A,B:B,1)
 
Upvote 0
Solution
Thanks for the cross-post link, yes I did post on the other forum :)

I still need help with formula in E5, not sure if I need to fill in more details on my desired outcome.
 
Upvote 0
Unfortunately the E5 formula is beyond my knowledge, which is why I didn't reply yesterday.
 
Upvote 0
Found solution to questions from the cross-post website.
Thanks for your help with some of the formulas.
 
Upvote 0
Glad you got it sorted & thanks for letting us now.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

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