Excel Lookup and choose to return the largest value of a each month

AlGuy

New Member
Joined
Mar 1, 2012
Messages
37
I used the formula below to get the last monthly price of an item
={LOOKUP(9.9999999E+307,CHOOSE({1,2},0,LOOKUP(2,1/((Market!$I$2:$I$9998<>"")*(TEXT(Market!$A$2:$A$9998,"mmm-yyyy")=B11&"-"&A11)),Market!$I$2:$I$9998)))}
In fact, I have 2 separate columns for year and month (referenced by B11 and A11) and the values are on a separate sheet.

The formula works great but now, I would like to do the same thing but return the largest value of each month without having to change the formula.
For example:

AB
1Thursday, May 11, 20061
2Friday, May 12, 20061
3Monday, May 15, 20060
4Tuesday, May 16, 200610
5Wednesday, May 17, 20060
6Thursday, May 18, 20061
7Friday, May 19, 20061

<tbody>
</tbody>


<colgroup><col></colgroup><tbody></tbody>

Based on the table below, the formula should return the value of 10. I can't simply use max because the days can change.

Is it possible? If not, what is the best dynamic formula, assuming that the days can change in the separate sheet.

Thank you!!!!!!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
1.

Define BigNum as referring to:

=9.99999999999999E+307

Change the formula you have to:
Rich (BB code):
=LOOKUP(BigNum,CHOOSE({1,2},0,LOOKUP(BigNum,1/((Market!$I$2:$I$9998<>"")*
  (TEXT(Market!$A$2:$A$9998,"mmm-yyyy")=B11&"-"&A11)),Market!$I$2:$I$9998)))

2. What is the relation of this formula to the exhibit you posted? Why not use the data this exhibit shows the max for each month year?
 
Upvote 0
Aladin,

Thank you (once again)for your suggestion. Unfortunately defining the BigNum as the last value of a series does not solve my problem. I am going to use the max formula instead, even if it will be time consuming and not dynamic.

Happy new year!
 
Upvote 0
Aladin,

Thank you (once again)for your suggestion. Unfortunately defining the BigNum as the last value of a series does not solve my problem. I am going to use the max formula instead, even if it will be time consuming and not dynamic.

Happy new year!

But what is the problem? And the max formula that solves it?
 
Upvote 0
But what is the problem? And the max formula that solves it?
Aladin,

Sorry for the delay. I have just tried to find the single annual value in a column of more than 1,000 rows which is always moving. I wanted to find a smart way to return the values knowing that each value belongs to a single year.

Just to be more precise, assume you have in a single column dividend amount for a company over 15 years and each row of the cell spreadsheet is a day (date in column A and dividend value in column B). Since the dividend is paid only yearly (in my case), I was hoping to get the single value within a year range, identified by the values in column A.
 
Upvote 0
Aladin,

Sorry for the delay. I have just tried to find the single annual value in a column of more than 1,000 rows which is always moving. I wanted to find a smart way to return the values knowing that each value belongs to a single year.

Just to be more precise, assume you have in a single column dividend amount for a company over 15 years and each row of the cell spreadsheet is a day (date in column A and dividend value in column B). Since the dividend is paid only yearly (in my case), I was hoping to get the single value within a year range, identified by the values in column A.

Not sure I follow... Say that we want to look at the month of january in 2013. Are you after the max value in column B while date values are in column A?
 
Upvote 0
Not sure I follow... Say that we want to look at the month of january in 2013. Are you after the max value in column B while date values are in column A?

Exactly. In fact, I am after the only value in B that matches the year in another cell. The formula below was successful at doing that for each end of the month value {LOOKUP(9.9999999E+307,CHOOSE({1,2},0,LOOKUP(2,1/((Market!$I$2:$I$9998<>"")*(TEXT(Market!$A$2:$A$9998,"mmm-yyyy")=B11&"-"&A11)),Market!$I$2:$I$9998))) where the values are in the Market sheet and the criteria (month and year) are A11 and B11.
 
Upvote 0
Not sure I follow... Say that we want to look at the month of january in 2013. Are you after the max value in column B while date values are in column A?

01/01/2010

Exactly. In fact, I am after the only value in B that matches the year in another cell. The formula below was successful at doing that for each end of the month value {LOOKUP(9.9999999E+307,CHOOSE({1,2},0,LOOKUP(2,1/((Market!$I$2:$I$9998<>"")*(TEXT(Market!$A$2:$A$9998,"mmm-yyyy")=B11&"-"&A11)),Market!$I$2:$I$9998))) where the values are in the Market sheet and the criteria (month and year) are A11 and B11.

Control+shift+enter, not just enter:
Rich (BB code):
=MAX(IF(TEXT(Market!$A$2:$A$9998,"mmm-yyyy")=B11&"-"&A11,
  Market!$I$2:$I$9998))


Does this meet your requirement?
 
Upvote 0

Forum statistics

Threads
1,216,750
Messages
6,132,503
Members
449,730
Latest member
SeanHT

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