I created a macro-enabled workbook in Excel that is used by around 100 people, mostly on Mac.
In my first version of the file, I used regular formulas, meaning with functions that were built into Excel. However, in my second version, which is what people are using now, I changed most formulas to use User Defined Functions, as it gave me a little more flexibility with what I could do with the formulas.
Several people are reporting that some cells with those formulas are changing to #NAME? at random times, instead of showing the result of the formula. This actually happened to me several time as I was creating it, and for that I was using Excel for Windows.
I've researched the issue, and found one forum post on Stack Overflow that said "Excel sometimes has an issue 'remembering' the dependency chains for its calculations. A symptom of this is when a known functioning file has strange errors in cells that you know should have values."
When this happened to me, I would save the file, close it, and reopen it. Every time I did this, the #NAME? error would be gone. So far, this has also worked for my users. However, it is very annoying for them to have to keep doing this. Does anyone have any idea how I could stop this from happening? Or is this just a bug in Excel that will continue to happen at random times?
UPDATE: I was able to reproduce the issue on my M1 Mac running Excel 16.68. I opened two copies of the workbook. After opening the second one, when I switched back to the first one and changed the value in a cell, I got the #NAME? error in a cell on the same row. (The cell had a formula that used a User Defined Function, as mentioned above.) I repeated this a few times, and it did it each time, so it does not appear to be a fluke. Here is a video showing the behavior:
https://youtu.be/6pwoBwjW9n8
I tried the same thing in Windows a few times and Excel never gave me the #NAME? error. So this may be an issue specific to Excel for Mac, though I cannot be sure, since I did receive the error at random times when I was creating the file in Windows. However, I have never seen the issue reappear in Windows since I "finalized" the file, meaning since I password protected the VBE and sent it to my users.
Does anyone have any idea why this is happening, and more importantly, how I can get it to stop happening?