Array Formula Lookup based on two variables

maxhewitt

New Member
Joined
Nov 29, 2005
Messages
1
Good afternoon!

I'm trying to create an array formula that will return a text string from a list of text/Month items.

Here is what I have so far:

=IF(MONTH(Completed!D2:D4)=12,IF(MIN(Completed!B2:B4),Completed!A2:A4,"NONE"))

The idea is that Column D contains a list of file completion dates, Column B contains the original file dates and Column A contains the text value to return.

The formula should return the text from the row with the oldest original file date that was completed in December (or return "NONE" if nothing is found).

Neat idea, but it doesn't work. What am I doing wrong here?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Welcome to the board!

Try:

=IF(SUMPRODUCT(--(MONTH(C2:C20)=12)),LOOKUP(2,1/((B2:B20=MAX(IF(MONTH(C2:C20)=12,B2:B20)))*(MONTH(C2:C20)=12)),A2:A20),"NONE")

Normal enter.
 
Upvote 0
maxhewitt said:
Good afternoon!

I'm trying to create an array formula that will return a text string from a list of text/Month items.

Here is what I have so far:

=IF(MONTH(Completed!D2:D4)=12,IF(MIN(Completed!B2:B4),Completed!A2:A4,"NONE"))

The idea is that Column D contains a list of file completion dates, Column B contains the original file dates and Column A contains the text value to return.

The formula should return the text from the row with the oldest original file date that was completed in December (or return "NONE" if nothing is found).

Neat idea, but it doesn't work. What am I doing wrong here?

Let A2 on the formula sheet house a first day date of the month/year of interest like 1-Dec-04...

B2:

=LOOKUP(REPT("z",255),CHOOSE({1,2},"NONE",INDEX(Completed!$A$2:$A$4,MATCH(MIN(IF(Completed!$D$2:$D$4-DAY(Completed!$D$2:$D$4)+1=A2,Completed!$B$2:$B$4,"")),IF(Completed!$D$2:$D$4-DAY(Completed!$D$2:$D$4)+1=A2,Completed!$B$2:$B$4,""),0))))

which must be confirmed with control+shift+enter.

If you have the morefunc.xll add-in:

=LOOKUP(REPT("z",255),CHOOSE({1,2},"NONE",INDEX(Completed!$A$2:$A$4,MATCH(MIN(SETV(IF(Completed!$D$2:$D$4-DAY(Completed!$D$2:$D$4)+1=A2,Completed!$B$2:$B$4,""))),GETV(),0))))

which still must be confirmed with control+shift+enter.

You can also invoke smaller formulas in multiple cells to obtain the same result.
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,305
Members
449,079
Latest member
juggernaut24

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