Max(If Formula

btadams

Well-known Member
Joined
Jan 6, 2003
Messages
1,943
I have data like this:

Column A = dates
Column C = values


and I'm trying to create a formula that will return the maximum value in column C if the month in column A is equal to the month of a given date. Here's what I've been trying to use but it gives me a value of zero:

=MAX(IF(MONTH($F$3)=MONTH($A$11:$A$100),$C$11:$C$100))

as an array formula (Ctrl+Shift+Enter). Does anyone have any suggestions?

Thanks,
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try it this way
Code:
=MAX(IF(MONTH($A$11:$A$100)=MONTH($F$3),$C$11:$C$100))

lenze
 
Upvote 0
I have data like this:

Column A = dates
Column C = values


and I'm trying to create a formula that will return the maximum value in column C if the month in column A is equal to the month of a given date. Here's what I've been trying to use but it gives me a value of zero:

=MAX(IF(MONTH($F$3)=MONTH($A$11:$A$100),$C$11:$C$100))

as an array formula (Ctrl+Shift+Enter). Does anyone have any suggestions?

Thanks,
Your formula looks OK so as long as you did in fact array enter it then that means either there are no dates that fall within the same month or the range C11:C100 doesn't contain any numbers that correspond to that date.

The numbers might be TEXT numbers which are different than NUMERIC numbers.

Find a cell where the dates meet the criteria and the number in column C looks like the max value. Test the cell in column C to see if it is in fact a numeric number.

Let's assume cell C10 is that cell.

=ISNUMBER(C10)

What result do you get from that formula?
 
Upvote 0
T. Valko,

You are correct. I've once again fallen for the old numbers-as-text scam. I'm such a ****** for that. (Fool me once, shame on you; fool me every time, Doh!)

Lenze,

Thanks for your time and response!
 
Upvote 0
or another option
Code:
=MAX(IF(MATCH(MONTH($F$3),MONTH($A$11:$A$100),0),$C$11:$C$100))
array formula so use Ctrl+Shift+Enter
 
Upvote 0
T. Valko,

You are correct. I've once again fallen for the old numbers-as-text scam. I'm such a ****** for that. (Fool me once, shame on you; fool me every time, Doh!)

Lenze,

Thanks for your time and response!
Ok, glad to have shed some light.

Just hope the fix was painless!
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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