MAX function

2077delta

Active Member
Joined
Feb 17, 2002
Messages
250
Office Version
  1. 365
Platform
  1. Windows
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.

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

Should it not be
{=MAX(IF(MONTH(wedate)=MONTH(A1)*wedate))}
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
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.
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