Hi all, I need a function to find maximum value of Count column between Name criteria and between two time criteria, as the same of below image :
Attachment 662090
Thanks in advanced.
Hi all, I need a function to find maximum value of Count column between Name criteria and between two time criteria, as the same of below image :
Attachment 662090
Thanks in advanced.
Last edited by amir0914; 02-11-2020 at 12:21 AM.
try this array formula:
=MAX(IF($A$2:$A$33=G2,IF($B$2:$B$33>=H2,IF($B$2:$B$33<=I2,$B$2:$B$33))))
...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
Thanks, if you have clicked on the * and added our rep.
If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".
"Contentment is not the fulfillment of what you want, but the realization of what you already have."
Tips & Tutorials I Compiled | How to Get Quick & Good Answers
Also an array (shift control enter) but slightly shorter
=MAX(($A$2:$A$33=G2)*($c$2:$c$33>=H2)*($c$2:$c$33<=I2)*($B$2:$B$33))
Thanks to benishiryo, your code is working well, Can you also write functons to rnage K1 and L1 for extract first and last item by the same criteria.
For example for "A1" value in Name field by time criteria, the first value of column Count is "1" and last value is "4". I also have uploaded the sample file. thanks to 6StringJazzer for your guidance.
you probably addressed the wrong person. you used davsth's formula.
an array formula for K2:
=INDEX($B$2:$B$33,MIN(IF($A$2:$A$33=G2,IF($C$2:$C$33>=H2,IF($C$2:$C$33<=I2,ROW($C$2:$C$33)))))-ROW($C$2)+1)
and for L2:
=LOOKUP(2,1/(($A$2:$A$33=G2)*($C$2:$C$33>=H2)*($C$2:$C$33<=I2)),$B$2:$B$33)
for l2 I wold do the same
for k2 as an array, either
=INDEX($B$2:$B$33,MIN(IF(($A$2:$A$33=G2)*($C$2:$C$33>=H2)*($C$2:$C$33<=I2),ROW($C$1:$C$32))))
or
=INDEX($B$1:$B$33,MIN(IF(($A$2:$A$33=G2)*($C$2:$C$33>=H2)*($C$2:$C$33<=I2),ROW($C$2:$C$33))))
THank you both, your codes work perfect, I want to type time value manually, but it's not working : (time value replaced with H2 range in above code)
=MAX(($A$2:$A$33=G2)*($c$2:$c$33>="09:00:01")*($c$2:$c$33<=I2)*($B$2:$B$33))
Why doesn't time value work right?
That is text. See if this works:
=MAX(($A$2:$A$33=G2)*($C$2:$C$33>=TIME(9,0,1))*($C$2:$C$33<=I2)*($B$2:$B$33))
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
Thanks for the rep.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
Thany you AliGW, But my problem hasn't resolved yet, I have another question, I want to put date instead time, is this right :
=MAX(($A$2:$A$33=G2)*($C$2:$C$33>=date(01/05/2016))*($C$2:$C$33<=date(04/05/2016))*($B$2:$B$33))
Thanks in advanced.
Attach file for new question
The date bit needs to look like this:
DATE(2016,5,1)
Thank you AliGW, you did great.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks