PDA

View Full Version : Solved: How incorporate an OR( into a MAX(IF( function?



Sir Babydum GBE
11-24-2009, 05:59 PM
Hi,

I have a workaround for AND in a MAXIF array as follows:=MAX(IF((B3=RecordNames)*(RecordCourse<>$R$1)*(RecordCourse<>$S$1),RecordLastDates))

However I also want a similar formula where I want the greatest date if RecordCourse Equals $S$1 OR RecordCourse Equals $R$1

I've tried using an Or in the array but it doesn't work

Sir Babydum GBE
11-24-2009, 06:16 PM
Oh, I fixed it myself!



=MAX(If((B3=RecordNames)*(RecordCourse=$R$1:$S$1),RecordLastDates))


That was easier than I thought.

Am I on my way to being an Excel Guru now?

Bob Phillips
11-25-2009, 01:35 AM
Are you sure that worked BD, it didn't it my tests?

This does work though.



=MAX(IF((B3=RecordNames)
*((RecordCourse<>$R$1)+(RecordCourse=$S$1))
,RecordLastDates))


BTW, Your first one doesn't work either, not unles R1 = S1

Sir Babydum GBE
11-25-2009, 04:03 PM
Are you sure that worked BD, it didn't it my tests?

It did in my tests... But I didn't test it properly. It appeared to work but, after your post, I tested with a bit more date variety and, guess what, you were right!

Look Bob - I'm a VBAX Contributor and you're, well.... Distinguished Lord of VBAX. How am I supposed to compete with that??

What the heck do you expect, people????

Leave me alone!


(Thanks Bob)

Bob Phillips
11-25-2009, 04:21 PM
What the heck to you expect, people????

Leave me alone!

I will never leave you alone! As long as you are seeking help, I will be looking over your shoulder, making sure that you do your job properly. (cue crescendo) I owe it to the world ...........

Sir Babydum GBE
11-25-2009, 04:23 PM
I will never leave you alone! Oh, ok.

Bob Phillips
11-25-2009, 04:43 PM
Oh my lord, I thinbk I goofed on my formula too.

is this better?


=MAX(If((B3=RecordNames)
*((RecordCourse=$R$1)+(RecordCourse=$S$1))
,RecordLastDates))