0

I am using an array formula to calculate cash flow based on length of memberships and total membership value. This is my formula:

{=IFERROR(IF(MOD(DATEDIF($N8,AB$7,"m"),$S8)=0,IFERROR(HLOOKUP(MIN($Z$7,INT(DATEDIF($N8,AB$7+1,"m")/$P8)),$U$7:$Z$111,_xlfn.SINGLE(ROW($A8))-ROW($A$6),FALSE)/(12/$S8),0),0),0)}

Any change I make in column J to update my total membership amount, which is a hard coded value, causes all the results in my entire spreadsheet to disappear and I get cells with only a dash in the middle. The formula is still there though.

I am using excel through office 365. This spreadsheet is saved in dropbox and other users who have access to the spreadsheet are not having this issue. Can someone help me figure out why all the results are gone and how to prevent this from happening?

2
  • Welcome to Superuser,, please edit the post & share some sample data or share the Sheet on cloud, help us to examine the issue & fix it. Jun 24, 2020 at 6:30
  • Did the formula reference cells from other Workbook? You can provide the sample file or more information about this problem.
    – Lee
    Jun 24, 2020 at 8:39

2 Answers 2

1

First point of interest, and thing to verify, is that a display of a dash in a cell is usually a number formatting which displays a dash rather than the 0 which is the actual value of the cell. Quick and easy to check that via the formatting functionality available via a Right-Click or pressing Ctrl-1.

One expects it is so, so moving on, that would mean your formula is evaluating to be 0. The question is "Why?"

Your formula is conspicuous for two things of note here. One is that there isn't a sing J in it anywhere. Not even in the spelling of something. So ordinarily, you might have to head off into the world of how does something in column J affect your formula, figure which one, or several, cells or functions in the formula are dependent upon something in column J. You know your formula better than we can with the very sparse info given and it might be obvious to you. Or that might be a lot of work. Either way... gotta be done.

BUT, before doing that, since you are clearly getting 0 for a result, you might wonder why... and that is the other conspicuous thing: the IFERROR() wrapping that's done: if there is an error, the two IFERROR()'s are set to return 0. The IF() itself provides a third source of a return of 0. So a quick test of which of these is the "culprit" could make your task easier.

Edit the formula three times: start with the IF() I suppose. It's "0" result is that first of the three 0's at the end of the formula. Change that to, oh, a 2, and save the edit. Does the result immediately change from a dash to something else, a 2 perhaps? Then the IF() contains the place where the column J value interacts with the formula. If not, press Ctrl-Z to restore thigns, then change the middle 0 to a 2. Is there a new result? If yes, then the HLOOKUP()" portion is the source of difficulty from column J. Undo again with Ctrl-Z` and change the final 0. If there was no change with the first two, then this is the source but just change it anyway and see that it does change from the dash to something else.

Your formula seems well and properly written and the change you describe seems like it could never cause an issue without some exceedingly weird thing going on which seems very unlikely, so I would suspect a logic error of some kind. By that I mean something that does not make sense to Excel. Dividing by 0 is always a good concern if division takes place so that's high on the list as well. The only division I see is in one of the values for the MIN() function and it is hard to imagine how a slight change to your memberships would make it 0 leading to a divide by zero error. Back to the "doesn't make sense to Excel" thoughts.

Your INT() function... if the division we just talked about results in a value <1 (well, -1 < value < 1, but it seems likely all the values are positive so <1), then INT() will return 0 for a result. No problem usually, but you feed a lookup function with that result, telling it to find "0" in the values in U7:Z7. If there is no 0 in that range, there will be no match and since the option there is "FALSE", the lookup will return an error so the inside IFERROR() that wraps it will return 0 leading to a dash displayed.

Other likely problem areas would include the row the lookup returns. But it is unlikely in the extreme since it would never work but it does work until column J's change is made. Similarly, the MOD() at the start should either work always or never as it seems unlikely the change in column J would make S8 be 0, the only way it seems likely a failure could happen there after a change in memberships. However, we don't know what S8 is and S8 IS used in a later division (very end of the formula) where it would cause the same error if it reached 0. Still, seems unlikely.

My bet, with the sparse information, is that you'll track it down to the INT() portion. The calculation there should not see the numerator increase from the described change since the months ought not to be changing but it could see an increase in the denominator (P8) could drive the result below 1 giving you a zero for the lookup. (I keep mentioning a 0 there, but really, the worry is simply driving it out of the range of the six values in U7:Z7: if they are "4,5,6,7,8,9" and you get a 3, it's the same error result.)

If that strikes a chord, you just need to verify it and fix the issue. If it doesn't seem to fit what you know of the structure of things, well, we didn't know that structure and it wouldn't be surprising. But even so, the above should give you some thoughts as to how to troubleshoot such things.

If none of the above shortened the work time, start from the other end, the harder, usually, end, and work forward: what is the first place affected by making the change in column J? What does that then affect? Keep going until the next place affected is your formula. See if any of those would ruin your formula's results. One must, or a result along the way returns an error, perhaps, feeding the error forward into your formula. (Again, we have literally no idea of the particulars so giving you better than that generality is pretty hard to picture.)

So the key is the dash almost certainly means a 0 is being returned which in turn means one of the IFERROR()'s or the IF() is reurning a 0. That's a general observation, but true nonetheless. It is hard to see your IF() doing that for the change describedand therefore hard to see the outside IFERROR() being the culprit either. So the inside one seems likeliest. An increase in memberships deosn't seem likely to drive down the value of the DATEDIF() in there, so pushing it out of the value range needed to match U7:Z7 seems likeliest due to P8 getting bigger from that column J increase. Frankly, the apparent use for the lookup here seems... unusual... but it works pre-change so one figures the concept itself is fine. Outside of the formula, you should look for an increase somehow causing an error result in any cell using the info, that then feeds into this formula. (Not seeming too awfully "summary-like," I admit, but that is due to the scarcity of details to point to.)

Remember though, it's all a learning experience. And that which does not kill you makes you stronger. And so on.

0

Since your formula contains this:

_xlfn.SINGLE()

I assume that you are using a version of Excel that doesn't support dynamic-arrays, nor the implicit intersection operator @.

As described here:

If you author or edit a formula in dynamic array Excel that contains the @ operator, it may appear as _xlfn.SINGLE() in pre-dynamic array Excel.

Further to that:

This occurs when you commit a mixed formula. A mixed formula is a formula that relies on both array calculation and implicit intersection, this was not supported by pre-dynamic array Excel. Pre-dynamic array only supported formulas that did i) implicit intersection or ii) array calculation throughout.

What this means is that you will need to debug your formula to determine why it is considered a "mixed" formula.

Without more detail regarding your data in your post, it is difficult to do that here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .