MAX function

2077delta

Active Member
I have the following list of data:

01/12/02
01/12/02
01/12/02
01/19/02
01/19/02
01/19/02
01/19/02
01/26/02
01/26/02
01/26/02
01/26/02
02/02/02
02/02/02
02/02/02
02/23/02
02/23/02
02/23/02
02/23/02
03/02/02
03/02/02
03/02/02
03/15/02
03/15/02
03/26/02
03/26/02

Assume the range of data is named "wedate" and starts in cell A10. In cell A1 is the date 01/31/02. I have the following formula entered into cell A2 =MAX(MONTH(dtldate)=MONTH(A1)) and enter it as an array. I want the formula to return the maximum date from "wedate" that falls in the month in cell A1. Unfortunately my formula returns -0-. Is there a way to write the formula to return the maximum date in "wedate" that falls in the month in cell A1?

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
If wedate is sorted in ascending order, use:

=INDEX(wedate,MATCH(MONTH(A1)&YEAR(A1),MONTH(wedate)&YEAR(wedate)))

If not, use:

=MAX((MONTH(wedate)=MONTH(A1))*(YEAR(wedate)=YEAR(A1))*wedate)

each to be array-entered.

Something like this ?

{=MAX(IF(MONTH(wedate)=MONTH(A1),wedate))}

Array entered.

Juian pablo wrote
{=MAX(IF(MONTH(wedate)=MONTH(A1),wedate))}

Should it not be
{=MAX(IF(MONTH(wedate)=MONTH(A1)*wedate))}

On 2002-08-20 17:35, Nybbe wrote:
Juian pablo wrote
{=MAX(IF(MONTH(wedate)=MONTH(A1),wedate))}

Should it not be
{=MAX(IF(MONTH(wedate)=MONTH(A1)*wedate))}

No, unless you remove the IF.

BTW, maybe adding YEAR is also needed as I proposed.

On 2002-08-20 17:38, Aladin Akyurek wrote:

No, unless you remove the IF.

BTW, maybe adding YEAR is also needed as I proposed.

Agree Aladin, you know I don't like working with dates... thanks for pointing that out.

Replies
4
Views
258
Replies
7
Views
146
Replies
3
Views
131
Replies
5
Views
229
Replies
6
Views
207

1,207,281
Messages
6,077,511
Members
446,287
Latest member
tjverdugo85

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.

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

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