PDA

View Full Version : Solved: Maxif UDF required



anandbohra
06-26-2007, 10:35 PM
Hi friends.
I made an array function with the help of various forums

the function is simple
here is the data first (column wise)
A----B
01-01-07----50
02-01-07----60
01-01-07----70
04-01-07----50

now my syntax is (C1 to C n... contains unique date fields which is simple to generate)
=max(if(A1:A4=c1,B1:B4,0)

this will give me max of B for the given date in C1
but i have to press CTRL+Shift+Enter to make this array function

now as u know we all always press enter after function so can any one help me by making this function as UDF like sumif :dunno
the Syntax of UDF will be =Maxif(range,criteria,maxrange)
same like Sumif function =sumif(range,criteria,sumrange)

waiting for reply

unmarkedhelicopter
06-27-2007, 01:16 AM
=SUMPRODUCT(MAX((A1:A4=C1)*(B1:B4))) works for me. :)

unmarkedhelicopter
06-27-2007, 01:27 AM
Try to steer clear of UDF's if you can as they slow your calculation speeds right down.

anandbohra
06-27-2007, 01:33 AM
thanks unmarkedhelicopter

this is better than UDF