I have a source xls file with a list of due dates down a column. The date is entered as text in the format 'mm-dd-yyyy.
Consider this file read only; I do not want the user having to format anything - it's plug-and-play!
The target xlsx file (must run on excel 2003) has a column of formulas using INDIRECT and OFFSET to find each of the source file dates and compare them to today's date.
For example: F2=AND(Logical1, Logical2, OFFSET(INDIRECT(filename.xls]"&"sheetname'!"&C1&"2"),G2,0,1,1)>=TODAY())
Where C1 is the desired source column (found by header name using MATCH, then formatted into letters using ADDRESS)
G2:G500 are static values for the row offset, from 0 to 49.
F2:F500 will contain True if the "Logical1/2" conditions are True and the date from the source file in the corresponding row is on or after today's date.
So here's the scenario: I'm pulling a date from the source file. Let's say it's '02-11-2014 (February 11 2014). That works fine with
=OFFSET(INDIRECT("'[filename.xls]"&"sheetname'!"&C1&"2"),G2,0,1,1)
Now I need to convert it to an actual date, but I haven't been able to achieve this with DATEVALUE or TEXT:
=--TEXT(OFFSET(INDIRECT("'[filename.xls]"&"sheetname'!"&C1&"2"),G2,0,1,1),"mm-dd-yyyy")
=DATEVALUE(OFFSET(INDIRECT("'[filename.xls]"&"sheetname'!"&C1&"2"),G2,0,1,1))
I get #VALUE
Maybe I need to change the dashes (-) to slashes (/)
=DATEVALUE(SUBSTITUTE(OFFSET(INDIRECT("'[filename.xls]"&"sheetname'!"&C1&"2"),G2,0,1,1),"-","/"))
Nope. Doesn't work. That's the first problem.
But let's assume I got the formula right and it returned a proper date number.
Did it return the date as Feb 11 2014, or Nov 2 2014? That's the second problem.
Beyond avoiding MM and DD mixup, I need to get the date into the same format as the regional date format for whatever computer is running the spreadsheet.
I use dd/mm/yyyy, but someone else might use mm/dd/yyyy or something else.
I'm assuming if I manage to do the above using DATEVALUE it will internally convert it to a universal date serial number. Is that right?
In summary, I need to reference another file, pull a value from a cell, format it, change it to a date number, and compare it to TODAY(). All in one single formula.
I can't format the source file. I also don't want this spreadsheet to turn into an 8MB behemoth. So I don't want to be importing all the due dates from multiple files into multiple sheets, operating on them through multiple steps, creating more columns with more formulas and more data just to get a true or false, for each date.
I'd also like to avoid things like this monster running down 500 rows in 14 different sheets if possible:
=AND(ISBLANK(OFFSET(INDIRECT("'[filename.xls]"&"sheetname'!"&C2&"2"),G2,0,1,1)), OFFSET(INDIRECT("'[filename.xls]"&"sheetname'!"&C3&"2"),G2,0,1,1)>0, DATEVALUE(MID(OFFSET(INDIRECT("'[filename.xls]"&"sheetname'!"&C1&"2"),G2,0,1,1),4,2)&"/" &LEFT(OFFSET(INDIRECT("'[filename.xls]"&"sheetname'!"&C1&"2"),G2,0,1,1),2)&"/" &RIGHT(OFFSET(INDIRECT("'[filename.xls]"&"sheetname'!"&C1&"2"),G2,0,1,1),4))>=TODAY())
That repeated 7000 times across the 14 sheets would be 2.8MB just for that formula if I'm counting right.
Thanks for your time and any suggestions, insight, or links you can provide.
Bookmarks