I know it's a recurring question, but I haven't found an answer yet... My issue is that a formula that contains a path in Excel it's being updated under the following two events:
Opening that file from another laptop connected on the same net. Then the path changes from: 'D:\files...' to '\LAPTOP1\files...'
The second case is when laptop reboots (for example after a Windows update). Then the path becomes something like: 'C:\Users\john\AppData...'
The formula I'm using is:
=SUMPRODUCT('D:\files\excel01.xlsm'!ITEMS*('D:\files\excel01.xlsm'!ITEM_id=$C26))
I know the possibility of using INDIRECT but the problem is that it returns #REF when searched files are closed. Using SUMPRODUCT I can retrieve values from closed workbooks, but I would also keep paths as they are written.
Any suggestion?
Thanks in advance!
Related
I have searched the internet and Stack Overflow, but couldn't find an answer to my problem.
I defined a UDF in Excel, it's saved in a module in an .xlam Add-In. The UDF works perfectly fine on my computer. Now I'm trying to use the workbook which uses the UDF on another computer (in a different language) with the same .xlam Add-In active. However Excel suddenly references the entire path to the add-in file as an "absolute path" instead of only showing the function name itself. The result is a #NAME? error because Excel doesn't find the UDF.
How I have written the VBA Code
How it should look
How it looks on another computer
Has anyone had this issue and found a solution for it? I could try to find a workaround without the UDF function but I'd prefer that it works this way. Another time the situation might be more complex ...
The problem with your UDF is the location of the .xlam file. You can find information on dealing with that by following the link in the comments above provided by Christofer Weber.
Having said that, I think it may be more beneficial for you to use the built-in formula that excel has for this which is EOMONTH()
EOMONTH() can be used to return both the last day of a month and the first day of a month (by finding the last day of the previous month and adding 1)
You can find more information on EOMONTH() here https://support.microsoft.com/en-us/office/eomonth-function-7314ffa1-2bc9-4005-9d66-f49db127d628
I have a program which generates an Excel file. Specifically, it's a node app which generates a JSON file which is loaded into GrapeCity's SpreadJS and exported again via their ExcelIO libs. This file has a lot of formulae in it - at least a thousand of various forms built according to various rules from an input data set which is itself non-trivial. Whilst these files load file in SpreadJS and export in such a way that they load in Excel and appear to work, I get a number of errors from Excel when I try to load it:
Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.
Removed Records: Formula from /xl/worksheets/sheet1.xml part
Removed Records: Formula from /xl/worksheets/sheet2.xml part
Removed Records: Formula from /xl/worksheets/sheet3.xml part
After I initially posted this question, I eventually figured out that this was because the formulae in question were using single quotes for text strings rather than double. The question is - without playing guessing games, how could I identify which formulae Excel has removed / fixed? Excel's so-called log file is just a repetition of the equally unhelpful references.
Any of the following would count as good answers:
A way to get Excel to tell me the string of the formula which it has a problem with
A way to get Excel to tell me the cell reference (e.g. F5) of the formula which it has a problem with
An external tool which would do the same
A library or tool for validating Excel formulae which I could run on either the Excel file or the original input which would give me similar output. If it was an npm lib that would be even better
thank you for using SpreadJS.
Can you please share the original spreadjs file (ssjson) with our team, they can perform the export and figure out what might be causing this. In general exported files should not product file open errors, even if the formula is incorrect.
Grapecity Team
http://www.grapecity.com/spreadjs
https://github.com/LesterLyu/fast-formula-parser/ works for verifying formulae.
A very similar question was asked 3 years ago but with no satisfactory answer.
I have the following folder structure
|--A
|----A.xlxs
|--B
|----B.xlxs
A.xlsx looks like so
B.xlsx Looks like so
And when I apply the below (untested) function to column 2 of spreadsheet A.xlsx, it looks exactly like spreadsheet B.xlsx
INDEX(C:\....\B\[B.xlxs]Sheet1'!$B$1:$B$5,MATCH(A2,C:\....\B\[B.xlxs]Sheet1'!$A$1:$A$5))
And now every time I open B.xlsx, without changing a single thing, I get this result in A.xlsx
Questions:
Why does this happen?
How can I prevent this from happening?
How can I use relative, instead of global, paths (ie. ensure it works if I transfer to a USB drive)?
Additional Info:
My files are stored on a NAS, if that makes a difference
I want to reference an external workbook that is open. If I type =path\[file] directly into the cell (even though I am still asked to 'Update Values',) I am able to get the data I require. However, I am using INDIRECT because the name of the file changes everyday (date). So, I am using CONCATENATE to create a filename daily and then using INDIRECT to the cell where the concatenated formulas is. If you paste values to see what is being generated formula, it is exactly the same formula as above, =path\[file]. However, I continue to only get #REF! error.
I read through this, https://support.office.com/en-us/article/control-when-external-references-links-are-updated-87861952-ca9d-4d2a-a986-4d672c908d0d, and I still can not figure it out. I had it working on my computer at home last night but today and work it is giving me trouble.
To clarify, the formula that I am trying to get to work looks like this =INDIRECT("'"&CONCATENATE($F$129,$F$130,F95)) which worked yesterday at home. Can someone lead me in the right direction?
EDIT:
I have tried two options, =INDIRECT(F121) and =INDIRECT("'"&F121). The contents of F121 have been =CONCATENATE("'",F191,F192,F157) and =CONCATENATE(F191,F192,F157), respectively. I have also tried =CONCATENATE("'",F191,F192,F157) in the destination cell. F191 = [Liquidity Risk Dashboard v2.03 -, F192 = =TEXT(E3,"yyyymmdd")&"]", and F157 = Calculations'!D122. If I write ='[BMI Liquidity Risk Dashboard v2.03 - 20170105]Calculations'!D122 am asked to update values but, 100% have both workbooks upon in same instance
If I understand what you really have in your cells, the problem is that you are not properly naming the source workbook.
Try changing
F192: =TEXT(E3,"yyyymmdd")&".xlsb]"
Replace .xlsb with whatever the file extension really is for your file. (eg: .xlsx, .xlsm, .xls)
i have a folder with .xls files which are all named like xxx_day_month_year.xls and i want to look up for some values in this files by selected date.
I came to next solution:
=VLOOKUP(B3;INDIRECT("'G:\xxxxxxx..\"&G3&"."&G4&".2014_test.xls]HL'!$C:$D");2;FALSE)
Where cells G3 and G4 are desired day and month.
But this only works if I have opened documents in which I look up for data. Is there a way that this formula is going to work in independent document?
I did a bit of digging on my own, and it looks like the INDIRECT function will not work with a closed workbook. However, you could use VBA to accomplish your task.
Take a look at this previous post which explains a VBA workaround for a similar issue. You may be able to adapt it to your specific situation.