how to debug formulas

bigdan

Well-known Member
Joined
Oct 5, 2009
Messages
846
Office Version
  1. 2013
Platform
  1. Windows
I'm at a new job, have learned how to work with some excel files. With the files I'm working on there's 2 main tabs, Input (where I do my work) and Entry. In the Entry tab I just see an output which comes from the Input tab.

So far simple enough. The problem I have is at some points some data in the Entry tab doesnt appear. I get that #REF! error. I want to figure out how to decode this. I dont know if this is even something that CAN be explained on a forum, but if it can I'd be grateful. I'm not looking for you to tell me what this means in this case, I'm trying to figure out when there's sooooo many variables / dependencies in a formula how do you even start going about trying to figure it out. If its a few words I can do so but if you look at this really nasty piece of text you kinda get an idea.

The formula which sometimes gives me problems is:

=IF(U18="","",IF(AND(INPUT!$C$9="",INPUT!$C$9="Store to Store Tfr"),INPUT!N2&" "&INPUT!$C$9,IF(INPUT!$C$9="",INPUT!M2&" #"&INPUT!N2,INPUT!$C$9)))

Remember Input is the Input tab.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
In excel 2007 (I think this is true for 2010 also), on the Formulas tab there is a section labeled "Formula Auditing." I find the Evaluate Formula option to be the most useful, personally.


Some more comments.
Because the formula you posted doesn't contain anything saying #REF!, one of the precedents is (most likely) using as an input a cell that was deleted. Use trace precedent to find it, or use evaluate formula to step through the formula to find the cell.


I do see a problem with the formula posted. In your second nested if your logical condition is
Code:
AND(INPUT!$C$9="",INPUT!$C$9="Store to Store Tfr")
which will always return false -- how can 1 cell both be empty and contain a value of "Store to Store Tfr" at the same time? I suspect that the person who created the spreadsheet meant to use OR(), but that's something you'll need to look into.
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,792
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top