Problem with Indirect and Array Formula

ihni

New Member
Joined
Oct 4, 2009
Messages
3
I am having a problem getting this formula to work, i have 3 cells of text that at the beginning has a date in the same cell as the text.

eg;

A1: 9/26/2009 this is test A, B1: 10/10/09 This is test B, C1: 9/4/09 This is test C.

i am trying to find a way to fill a cell with the contents of the cell that has the latest date

i would like D1 to say "10/10/09 This is test B"

the formula i am using is
{=ADDRESS(1,MATCH(TEXT(MAX(DATEVALUE(TEXT(LEFT(A1:C1&"1/1/2009 ",SEARCH(" ",A1:C1&"1/1/2009 ")-1),"mm/dd/yyyy"))),"mm/dd/yy")&"*",TEXT(LEFT(A1:C1&"1/1/2009 ",SEARCH(" ",A1:C1&"1/1/2009 ")-1),"mm/dd/yy")&"*",0),4)}


the formula works fine and returns the address of the cell with the latest date.
if i then put in cell E1 the formula
=OFFSET(INDIRECT((D1)),ROW(E1)-1,0)
it gives me the result i want.

however if i try to combine the formula to find the cell with the latest date, within the offset/indirect formula, i receive an error "the formula you typed contains an error".

does anyone have any idea why this is, and how to fix it?

thank you
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hello and welcome to the board,

What is your system date format?
 
Upvote 0
If your date format is mm/dd/yyyy, try this

B1
Code:
=INDEX($A$1:$A$3,MATCH(MAX(LEFT(A1:A3,SEARCH(" ",A1:A3)-1)+0),LEFT(A1:A3,SEARCH(" ",A1:A3)-1)+0,0))

with ctrl+Shift+Enter
 
Upvote 0
ok so i got the formula to work using the index function as you suggested, i kept my original code intact as the one you had given me would return an error if there was a blank cell in the array eg; (one row only had two values instead of three, or the values were in A1 and C1)

i am now using the formula

{=INDEX($A$1:$C$1,0,MATCH(TEXT(MAX(DATEVALUE(TEXT(LEFT(A1:C1&"1/1/2009 ",SEARCH(" ",A1:C1&"1/1/2009 ")-1),"mm/dd/yyyy"))),"mm/dd/yy")&"*",TEXT(LEFT(A1:C1&"1/1/2009 ",SEARCH(" ",A1:C1&"1/1/2009 ")-1),"mm/dd/yy")&"*",0))}

it works perfectly, except... i only want the formula to return a result if the cell next to it, E1, has a date. i tried putting it in a simple if statement but it is giving me an error "the formula you typed contains an error".

i appreciate your help
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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