I need a user define function that will return largest number given a condition,MAX IF
The user defines function should look like, MAXif (array, condition)
Example,
Assume $A$1:$A$10 is list of numbers from 1 to 10.
so
MAXif($A$1:$A$10,">3")=10.
I need a user define function that will return largest number given a condition,MAX IF
The user defines function should look like, MAXif (array, condition)
Example,
Assume $A$1:$A$10 is list of numbers from 1 to 10.
so
MAXif($A$1:$A$10,">3")=10.
ck_123,
Check out this thread: http://www.excelforum.com/tips-and-t...y-formula.html
For your example, the formula would be:
Please Login or Register to view this content.
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
This will do the sample but I'm not sure how useful it will be to you:
Please Login or Register to view this content.
If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)
You can't do one thing. XLAdept
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin
actually i planned to develop case select user define function,maxif is just one of these,the code is working,but is that possible using code like "WorksheetFunction.Max" and "WorksheetFunction.index" to do the same thing,because i planned to develop minif,modeif,frequencyif and more,and i believe this will take a lot time and energy from all of you,so i just asking for maxif and learn to do the other.
i tried to convert the formula given by tigeravatar =Max(Index(($A$1:$A$10>3)*$A$1:$A$10,)),but fail due to poor knowledge in VBA.
Please Login or Register to view this content.
I always found that writing WorksheetFunction everywhere became quite onerous - this is how I get around that:
Please Login or Register to view this content.
the code cant work,by the way, i using the code ,and it work.
thank for your time and energy.Please Login or Register to view this content.
That Index code won't work but the the Min and others like it do work with the abbreviation - you're welcome!
Create a Module with the code below, then you will have a function called MAXIF, but must enable macros in sheet:
Formula:Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks