dynamically reference a cell in a closed file - excel-formula

I have a series of closed files with filenames depicted the month and year, i.e. Activity_(Dec_2016).xlsm. I am trying to get the value of cell K47, but the month varies. Here is my formula:
INDEX("'C:\...\[Activity_("&TEXT(A2,"MMM")&"_2016).xlsm]18'!K47",1,1,1)
Cell A2 = Today() with the format of MM/DD/YYYY
The result is a #VALUE error. When I hard code in the date, i.e. "Dec_2016", in place of the TEXT function it returns the correct value. Can this be done with excel (not vba)?
Thanks for your help.

Related

adding time from 2 cells in 3rd cell =#VALUE error

I'm trying to add (Formate) m/d h:mm, with =TODAY() in R26, with
(Formate) d h:mm in S26......
Formula '=R26+S26' in cell U26
all I get is #VALUE
Purpose: after entering the d h:mm value to S26, I need U26 to give me the m/d h:mm value, which is the format of the cell.
It's to give me the day and time that I need to attend to something that is expiring and needs to be renewed/reactivated.
I've tried 'S26=(NOW()+S26); S26=NOW()+S26; S26=NOW()+(S26)
anyone?
Excel time values are decimal numbers. If both cells contain real numbers, not text, then your formula should work. The #Value error shows because at least one of the values is text.
The format of a cell is not important when doing calculations. All that matters is the underlying data type.
Change the cell values to be real numbers (formatted as time).

Formula Referencing Excel Table

I am using Excel 2013.
I have a table with three columns: Start Date, End Date, and Holiday - a column containing a formula to check if a holiday falls between the Start Date and End Date. The Start Date and End Date columns contain references to other columns where the date is calculated. The formula in the Holiday column uses an Index/Match function to look in a list of holidays (on a separate sheet called SLA Holidays). This table has thousands of records ranging over a one-week time span, and is updated daily.
The holiday formula does not work - it returns FALSE even when there is a holiday in the time frame. Upon evaluating the formula, it says that the first logical of the AND function is FALSE; however, it is true (9/3/2018 > 8/31/2018). The formula correctly evaluates the second logical of the AND function.
When I replace my table references to Start Date and End Date with references to cells outside of the table containing those dates, the formula works correctly.
Below is a screenshot of a few records from the table, showing the 3 columns. I've also included an HTML version for copy-ability. The formula is as follows:
{=AND(INDEX('SLA Holidays'!$A$2:$A$7,MATCH(MIN(ABS('SLA Holidays'!$A$2:$A$7-[#[Start Date]])),ABS('SLA Holidays'!$A$2:$A$7-[#[Start Date]]),0))>[#[Start Date]],INDEX('SLA Holidays'!$A$2:$A$7,MATCH(MIN(ABS('SLA Holidays'!$A$2:$A$7-[#[Start Date]])),ABS('SLA Holidays'!$A$2:$A$7-[#[Start Date]]),0))<[#[End Date]])}
Start Date End Date Holiday
08/31/2018 9/4/2018 FALSE
08/31/2018 9/4/2018 FALSE
08/31/2018 9/4/2018 FALSE
When I use the exact same formula, but switch the table references with cell references containing the same dates, the formula works. Here is that updated formula:
{=AND(INDEX('SLA Holidays'!$A$2:$A$7,MATCH(MIN(ABS('SLA Holidays'!$A$2:$A$7-AC5)),ABS('SLA Holidays'!$A$2:$A$7-AC5),0))>AC5,INDEX('SLA Holidays'!$A$2:$A$7,MATCH(MIN(ABS('SLA Holidays'!$A$2:$A$7-AC5)),ABS('SLA Holidays'!$A$2:$A$7-AC5),0))<AD5)}
Is there a way to make this formula work with references to dates within the table?
The Start Date and End Date columns contained formulas to calculate the dates, not just the actual date value. I changed my Holiday formula to include the Value function, taking the value of the table column references, and this solved the error.

Excel: Hyperlink to jump to current date

I got an Excel sheet with all the dates of the year. And on the Top i want to do a link to jump to the current date... I got this
=HYPERLINK(VERGLEICH(HEUTE();D:D;0))
Thats just giving me the number of the line, where the current date is located.
By the way: Vergleich = Match // Heute = Today
How do I do that?
If HYPERLINK shall link to a cell, D12 for example, then the hyperlink address must be #D12. So =HYPERLINK("#D12") will work.
If the 12 shall be variable according to a matched value, todays date for example, then this value must be concatenated into the hyperlink address.
Example: Column D contains date values. One of those is todays date.
=HYPERLINK("#D"&MATCH(TODAY(),D:D,0))
German Excel:
=HYPERLINK("#D"&VERGLEICH(HEUTE();D:D;0))
This works only if in column D are date values, not strings, and really date values only, without time, and todays date is among them.
Say we have dates in column D like:
This formula will give the proper row for the cell containing today's date:
=MATCH(TODAY(),D:D,0)
We can use this in the hyperlink formula:
=HYPERLINK("#D" & MATCH(TODAY(),D:D,0),"today")
For example:

Using MONTH() in a cell formula converts the cell type to "Custom" date format

I have a cell that has the formula =INDIRECT(CHAR(COLUMN()+65)&ROW())*MONTH($A$1)/12 where INDIRECT references an integer and $A$1 is a date. For some reason, the MONTH part converts the entire cell into a date instead of a number. How do I change the formula to have it return a number in number format? (Manually changing each cell through the ribbon is not an option for me).
I haven't tested this (and I can't comment till I get 50 rep), but you could wrap the whole thing in a text formula, then multiply by 1:
=TEXT(INDIRECT(CHAR(COLUMN()+65)&ROW())*MONTH($A$1)/12,"#")*1
Hope this helps!

Excel: Check cell for date

Short story short:
I want to check the cell C21 if it contains a date. I can't use VB cause it's deactivated by GPO.
Used this from this page
D21 contains this:
=WENN(ISTZAHL(DATWERT(C21));"date";"no date")
in english
=IF(ISNUMBER(DATEVALUE(C21))...
C21 this:
=HEUTE() # in english: =TODAY() Maybe other dates later, but allways in the correct format
but it allways returns "no date"
Use this: =IF(LEFT(CELL("format",C21))="D",..,..). Learn more about CELL formula here.
In your example =TODAY() already a real date and not a date stored as text, so doesn't make too much sense to use DATEVALUE there.
Update
Here are some example dates and how CELL recognize them:
format value output
dd/mmmm/yyyy 12/June/2015 D1
dd/mm/yyyy 12/06/2015 D1
yyyy 2015 G
general 2015 G
dd/mm 12/06 D2
mmmm June G
dd mmmm yyyy 12 June 2015 G
Note: CELL is not volatile, so if the format of source cell is changed it won't be refreshed automatically, you need to either recalculate your sheet / book, either open the formula and press enter (also automatice recalculation initiated by any other volatile formula will cause it to refresh).
Use this formula, the expression will return TRUE if cell A1 contains an invalid date.
=ISERROR(DATE(DAY(A1),MONTH(A1),YEAR(A1)))
This formula works by evaluating each component part of the date: DAY, MONTH and YEAR and then aggregating them using the DATE function.
ISERROR will the catch any errors by returning TRUE (invalid) otherwise FALSE (valid).
Obviously the date value in cell (A1) must contain values >= 01/01/1900.
Useful for "Conditional Formatting".
Excel stores dates as numbers. 1 is 1-Jan-1900.
When it comes to numbers in a cell, Excel cannot tell if a number is meant to be a number or a date.
Today is 11/06/2015 as a date and 42166 as a number. For the consumer of a spreadsheet, the cell can be formatted to display the number as any number format or as a date. Excel formulas cannot tell whether the number in that cell is "meant" to be a date.
So, there is no Excel formula that you can use in a spreadsheet that will tell you if cell A1 is about 42166 widgets or if contains the date of June-11-2015.
Some of provided answers, checks cell format, which will not considers cell value, as you can format differently each cell no matter of its content, for checking if a cell value is date you can use this:
if(ISERROR(VALUE(c21)),"No Date", ----do staff for Date ----)
or shorter version which just will inform you "no date" status. If a date entry is find, it will return its numerical value instead:
IFERROR(VALUE(c21),"No Date")
hope this helps,
Cheers,
M
use the following formula ...
=IF(NOT(ISERROR(DATEVALUE(TEXT(C21,"mm/dd/yyyy")))),"valid date","invalid date")
I think it will solve your problem.
If the value is a string this method would work.
TEXT(DATE(VALUE(RIGHT(AI8,4)),VALUE(MID(TRIM(AI8),4,2)),VALUE(LEFT(AI8,2))),"dd.mm.yyyy") = AI8
Just wanted to add to the discussion that although you can check with a date(year;month;day) it will give you false positives, since the way it works is that it seems to just roll over values that exceed the logical limit, i.e. if you have the date 99-12-35 it will assume that you meant to write Jan 4th 2000, since that is the 35 - the 31 days of December. In other words, you will find some errors, but not all. Same goes for months exceeding 12.
try this formula (depends on date format):
=IF(DATE(TEXT(C21;"yyyy");TEXT(C21;"mm");TEXT(C21;"dd"));"contains date";"doesn't")
I tried every solution posted but none of them work if there are empty cells in the date cells, so I added a check to GBGOLC's answer and now it works with empty cells:
=IF(NOT(OR(ISBLANK(C21),ISERR(DATE(DAY(C21),MONTH(C21),YEAR(C21))))),"Yes it is a date","Not a date")

Resources