Adding a LAMBDA formula forces other users to reopen spreadsheet - excel

Issue: As the title says, any time a LAMBDA formula is used in my spreadsheet it forces all other users who have the shared spreadsheet open to reopen the spreadsheet.
With my brain's limited capacity, I am struggling to find anyone else struggling with this issue in any google search I've tried.
What I've tried: I've tried several methods to get the formula into the needed cells (thinking perhaps it was a macro that was breaking things) - regardless if I'm typing, copying/pasting, using VBA to write the cell contents, as soon as the cell contents are "locked in" every other user is forced to reopen.
Is this a known issue (that I just suck at googling) or "feature"? Has anyone else experienced this and/or found a workaround?
For use-case, and how I have things structured, I've included a link to a "neutered" spreadsheet that can be downloaded (making it live might break it as soon as someone else makes changes something, and I wouldn't have any way to ensure everyone has an original copy to look at)
https://www.dropbox.com/s/35gbt7shulx5ckt/PFab%20-%20error%20reproduction.xlsx?dl=0
In the O-T columns I would place the formulae =orderDate or =customLead(numberOfDays) (where "numberOfDays" is an integer entered, not a formula). Either of these will force the spreadsheet to reopen for other users.
Here are the custom formulae I'm using:
orderDate =IF(SFD="","",recurse(sub,daysOff))
SFD =PFAB!$A16 (row changes depending on cell selected)
recurse =LAMBDA(x,y,IF(OR(x=y,WEEKDAY(x)=1,WEEKDAY(x)=7),recurse(x-1,y),x))
sub =LAMBDA(x,y,IFERROR(x-y,TODAY()))(SFD,leadtime)
daysOff =OFFSET(daysOff!$A$1,,,COUNTA(daysOff!$A:$A),1) (dynamic range with stat holidays)
leadtime =INDEX(LeadTimeTable[Lead Time],COLUMN()-14) (row of table selected based on column formula is in)
customLead =LAMBDA(numberOfDays,recurse(SFD-numberOfDays,daysOff))

Related

The date displayed in an Excel sheet differs from the actual value in that cell

I came across a strange Excel book at work. When I retrieved a date value from any sheet in that Excel book, that value didn't match the date that it is supposed to represent.
However, the value 42978 doesn't represent 9/1/2021, but 8/31/2017. In fact, if you copied that cell to any cell in any sheet in another book, you would see 8/31/2017 in that cell. On the other hand, that value would always go 9/1/2021 in any cell in the original book. As seen, even though the macros have been disabled, I don't know how it can do that. I can't continue to work with that. Can someone please help me?
I would like to upload that Excel book, but probably can't contractually. And all macros in the book are password protected from editing and deletion, so I can't even see the contents of the macros.
There is an option within Excel which makes use of different date-systems: see https://learn.microsoft.com/en-us/office/troubleshoot/excel/1900-and-1904-date-system
Open Excel Options
Goto Advanced
Scroll down to When calculating this workbook and check/uncheck Use 1904 data system
This should fix your problem.

Excel is unfilling calculated cells at random

I have an Excel file on SharePoint.
Multiple people edit said file.
Offline and online.
Excel unfills all calculated cells (VLOOKUP and MATCH) that depend on other sheets in the same workbook at random.
So if you would open or reload that file, suddenly all the cells that use VLOOKUP or MATCH would be blank.
Upon further investigation nobody changed anything or deleted anything.
It just happens randomly.
Now it has happened 2 weeks ago and just today.
I have an interim solution that is to go to a cell with a formula, hit return, then click „overwrite all cells in this column with this formula“ and then click undo to prevent custom cell content to be overwritten.
Everything is back to normal afterwards.
I talked to a colleague, he has the exact same issue also totally at random.
He also encountered this on files that are not being edited by multiple people but himself.
So it is not dependent on the file itself.
Could the language play into this problem?
On some PCs Excel is in English and on some in German.
=IFERROR(IF(ISNA(VLOOKUP(D185,Sheet1!$B$3:$D$616,3,FALSE)),(VLOOKUP(D185,'Sheet2'!$B$3:$D$22200,3,FALSE)),(VLOOKUP(D185,Sheet1!$B$3:$D$616,3,FALSE))),"")
Seems like your sheet isn't calculating upon open. See if this link is of use to you.
https://superuser.com/questions/448376/what-is-the-excel-hotkey-to-re-calculate-all-formula-in-sheet
Also check your program settings and see if auto-calculate sheets is enabled. Don't know from the top of my head where it is located.
Alternative create a small vba function to force recalculate on workbook open.
Getting Excel to refresh data on sheet from within VBA

Groovy POI created cells considered blank by other programs until ENTER is manually pressed in cells

Ok this is kind of hard to explain.
I create a cell in my worksheet using JAVA POI
newCell= row.getCell(index)
if (containerCell == null) {
containerCell = row.createCell(index)
}
newCell.setCellType(HSSFCell.CELL_TYPE_STRING)
newCell.setCellValue(strVar)
If i then open the worksheet in EXCEL, I see that the cell value is indeed set. However if I load this into another external program that reads EXCEL sheets, it claims the cell I just set is blank.
NOW, if I go back into excel and do a simple "Hit return" on the cell in question, in the formula bar (even though its not a formula) and try to reload it into the external program, it works fine. Do I need to evaluate a formula on a string?
Thanks
I have no experience with Java, but having to hit enter in a cell is usually indicative of calculation being set to manual. Since you are working with API it may be treating your input from Java as a formula (?).
Open the offending workbook in its broken state, and on the sheet you are having problems with choose [Formulas] tab at top, then [Calculation]>Calculate Sheet.
If this updates the value then I see two options...
See if there is an option to manually calculate the sheet with POI, after the value has been entered.
Alternatively, you can write just a tiny bit of VBA to force calculation on that sheet when workbook is opened. MSDN offers a simple example.
http://msdn.microsoft.com/en-us/library/office/aa223802%28v=office.11%29.aspx
I have had to do this for Excel apps where calculation had to be set to manual to avoid excessive overhead. Just a guess though..
I am not sure why this was happening.. and evaluating the individual cells did not solve it however running evaluteAll() on the entire workbook made it work!

Trying to maintain a record of data in an excel cell

I am working with an excel sheet and wondering is there any way you can enter a currency value into a cell without completely removing the previous amount. I am trying to keep a record of numerous previous entries put into the excel sheet. It needs to be enabled so it is just a case of adding the new value and the previous values would be stored in the same cell. I know its a long shot but any help would be seriously appreciated. Would look something like below with the €1000 being the last entry and the €3000 being the first.
€1000
€1300
€1250
€3000
You cannot squeeze more than one value into a cell.
You could write VBA code that could, for example, use the Change event of the worksheet to add a comment to the cell and append the previous value to this comment. Or use this event to copy the previous value to a, perhaps hidden, worksheet.
For completeness I should mention that there is a Track Changes feature in Excel but it requires the workbook to be shared - which I do not recommend. Excel is not designed to work with multiple-users.

VBA: Finding a value, copying row, pasting row somewhere else, Finding the next value

So here is what I want to do in VBA:
Find the value in E10, copy the row it is in, paste the row somewhere else (doesn't matter as long as I can find it) then finding the next row with the value E10 and doing the same thing, etc, until I reach the end of the spreadsheet
I'm really new to VBA and macros in general, so any help would be appreciated!
Generally speaking you'll find that asking questions without explaining "what have you tried" tends to be frowned upon in these parts.
I suggest that you take a look at this somewhat similar question that I answered just earlier today:
Copy & Paste row of data in Excel 2003 to different sheet by Email search
The principal differences between that one and your need are:
Instead of an InputBox, you'll use the value in E10 to run the .Find method; and
You need to create a loop. You still run the .Find method as shown in my example but you do it in a loop until you've looped through every instance of the value in E10 in the sheet. (Get the address of the first range that you find, and keep running the .Find method until you get back to that address.) Look up the While statement and the For statement in VBA help for examples on how to create a loop.
To get the value of an individual cell one way is just to create a reference to the cell range, then query the .Value property. For example a fully qualified reference could be:
Thisworkbook.Worksheets("Sheet1").Range("E10").value
There are other syntaxes which will yield the same result, but you can learn about those in time. Recording your actions using the Macro Recorder is a good way to learn about properties and methods. The problem is that in yet another part of the Excel 2010 interface that I detest, Microsoft has decided to hide the thing. To get to the Macro editor, go to File -> Options -> Customise Ribbon and turn on the Developer tab.
Give all of that a try and if you get stuck with something specific, post again with the details.

Resources