Excel 2003 DSUM not working - excel

A client of mine has a major application written and running in excel 2003 ( I know, and they know, that it is a mistake, and they are waiting for it to be properly incorporated into their SAP application. They have been waiting for many years. ). Most of the time it works fine, however this week they had a problem, and the data was returning #value entries.
As I looking into this, I identified that a DSUM function was returning #value, which was then being spread across other places ( did I mention that there is no data verification in the VBA code? ) When I looked at the function, which is summing a column in a separate sheet, with a conditional, it identified a number of problems in the data, but even when I fixed them, and the Function analysis indicated no errors, it still returned #value.
I would post some of the code, but there is a 4700 row sheet involved, which is rather inpractical. Can anyone suggest what I might be able to do to progress this? Why is the DSUM returning #value problems, when there is no indication of any errors in the source sheet? I have searched through the column, and all of the values are valid numbers.
Sorry to be a little vague, but if anyone can give me suggestions as to how to progress, it would be appreciated. Excel and VBA are not my real specialities.

The only way I could get a #value was 3 fold:
If the criteria (the 3rd parameter) contained less that 2 cells.
If the data had a #VALUE in it that was propagated through.
Or if the first row of the database/table contained a value instead of text (even a number formatted as text fails in my example).
Do you still have the offending version of the spreadsheet? Might be worth ensuring the first row of data for errors particularly cells that look like text but have values in them (i.e., cell formatting can be used to display text even if there is a value in the cell, or if the first row is also calculated).
Hope this helps, and do let us know how you get on.
Dave

Related

Formula using sumifs and indirect function for worksheets. Getting Reference error although Had it working with different columns

Using excel 365. I have used this same formula for "asset allocations" and it worked perfectly.
I decided to do the same for sector allocation and I can not figure out what is wrong. This has beat me down. I have tried for 2 days. I thought that I could just exchange the category for sector. Didn't work. Thank you for any help.
Here is the image which shows the sheet that I am using.
The formula in G6 is:
=SUMPRODUCT(SUMIFS(INDIRECT(K$6:K$11&"[Value]"),INDIRECT(K$6:K$11&"[Sectors]"),[#Sector]))
You can see a REF Error on the column "Value".
This image is to show where the "Sectors" are listed on the individual sheets that I wish to sum.
Unusual, but this is working fine in my test scenario.
Use the Evaluate Formula tool to see where the error creeps in. You may have a typo in the list of tables.
I should have found the answer earlier but I didn't question my table columns.
In my last table the Column was accidentally called "Sector" and it should have been called "Sectors". I needed to pinpoint the point of problem by debugging better.
This code does indeed work fine for anyone wishing to sum by a category from more than one sheet. Not saying it is elegant code but it is easy to understand.

VLOOKUP returning N/A when it has previously found the value

So I have a list of country codes for records which I am trying to convert to country names in my spreadsheet. I created a lookup table on a separate tab, and used the formula: =VLOOKUP(F31,'Country Code Lookup'!C1:D249,2,FALSE)
Then I dragged the formula down the column to fill in the data. Everything was working but then I noticed that some cells were giving me N/A... even when the data had been correctly been found at an earlier point in the column (see attached graphic).
As you can see, it already found Finland earlier in the table, but yielded an N/A later. I tried this on both Excel and Libre Office Calc btw, and it came up with the same errors. The country codes were TRIMmed from another column to remove spaces that were in there, so I thought there might be an issue with hidden characters or something, so I deleted FI in the second instance, and put it in manually to see if that fixed the issue. Nope. Also deleted the value from the lookup table and manually reentered... same result. So now I am at a loss as to what to do, as this error is popping up all over the place and my spreadsheet is over 1000 rows long, so I don't want to be manually correcting the errors. Can anyone provide some insight on how I might solve this?

Excel 2010: Formulas not showing correct answer

I'll try and explain this as best as I can, it's a strange one so please bear with me. For the record I am using Excel 2010 (although I have seen this a couple of times before on previous versions also), and the model is fairly large (~30MB) containing around 20 sheets, and around 15 modules (although very well optimised and calculation times are non-existent).
I don't have the exact figures to hand, but for example in cells A1:A3 I have the values 823.50, -350.00, and -497.50 respectively. In cell B2, I am simply adding the values in column A by using =A1+A2+A3.
One would expect the result to show -24.00, but in fact shows something along the lines of 548.50.
Calculations are set to automatic
Application.ScreenUpdating = True
Formatting is set to General
Manually stepping through the 'evaluate formula' dialog returns the correct result right up until the last step, which then gives the incorrect result
This can be fixed manually by entering into the cell, and coming back out again (effectively F2 then enter), after which the cell shows the correct result.
It is definitely not just a visual error, as the incorrect result gets fed into other calculations. I know the quick fix is to F2 and enter each cell, but it was only by chance this morning that the error was spotted, and could have easily resulted in a very large, false cost.
Edit
Forgot to mention that this affected ~50 cells this morning, not just the one
Has anyone had any experience with this issue? Is it a known issue, and therefore a known solution?
Any help would be greatly appreciated.
The only things I've noticed was to use '=Sum' instead of just '=', but have never been sure it actually functions differently.
also, from MS: If an argument is a cell range or reference, only numeric values in the reference or range can be added

AVERAGEIFS does not work, but AVERAGE(IF( does

We have a large spreadsheet that we use to calculate performance for race car drivers. It has been stable for quite some time. Today, I opened it and found that one of the tables was not calculating correctly. I tried recalculating the sheet (it is set to manual calc), and tried rebuilding the tree (ctl+alt+shift+f9) to no avail. Other formulas referencing the same named range function correctly as do other formulas using average if.
Variables
list_of_names = A list of first and last names in a single text string imported from a CSV file
local_name = A name (100% guaranteed to be included in list_of_names) to calculate an average of a drivers performance in a given sector of the track
sector_percent = A percentage of a driver's trips through a particular sector that fall into a pre-determined range
sector_count = The number of trips the driver makes though a sector
My original formula returns a #Value error. This is the original formula (the actual formula contains an IFERROR statement, but I have removed it here for clarity. The #VALUE error happens either way).
{=AVERAGEIFS(sector_percent,list_of_names,local_name,sector_percent,">0",sector_count,">"&min_number_sectors)}
After some experimenting, I have found that the following formula successfully reports the correct answer:
{=AVERAGE(IF(list_of_names=local_name,IF(sector_percent>0,IF(sector_count>min_number_sectors,sector_percent,0))))}
If you strip the list_of_names and local_name variables from the AVERAGEIFS formula, it behaves correctly (given the data that meets the criteria). This led me to believe that the list of names and the local name were not of a matching data type. However the #VALUE error still occurs if both are set to general or text. TYPE(list_of_names) or TYPE(local_name) both return 2 presently. {TYPE(list_of_names)} returns 64 as it should.
The sheet is able to perform the list_of_names to local_name function correctly in other places in the workbook and in other areas of the same sheet.
I have tried:
-Replacing all named ranges with the actual cells referred to by the name in the formula
-Referring to different local_names in the list_of_names
-INDEX(list_of_names,ROW(A1)) correctly reports the list of names when you drag it out.
-Various orders of criteria, using other criteria.
-A number of other heat of the moment changes that I can't currently recall
Essentially, the list_of_names to local_name comparison fails in this area of the sheet every time using AVERAGEIFS where AVERAGE(IF( does not.
To me the formula is correct either way, but the sudden failure in this one part of the sheet is odd.
This is my first post here and I would appreciate any help that is available. Hopefully, I have provided enough information to lead to an answer. If not, let me know and I will fill in any gaps.
Both #barryhoudini and #Jeeped are correct. I had failed to drag the information in one of the source tables far enough creating a size mismatch in the range sizes. I can't figure out how to accept that as an answer other than to answer it myself, which would not apply the proper credit where it is certainly due. I thank you both for the assistance, it was concise and excellent. I still cannot understand why one formula works and one does not. Is it possible that the AVERAGE(If has a less restrictive set of constraints when it comes to range size?

Concatenate Formula (Getting a #REF Error)

Afternoon all :)
This is kind of a little difficult to explain but ill happily clarify where ever it is needed. Thank you for taking the time to read this post ^^ Here goes..
I am currently creating a spreadsheet that is been extracted from the database whereby I am tasked to concatenate data from 2 adjacent cells. I change the database on a frequent basis adding or removing data wherever necessary so the range of data is always different. To concatenate the two cells I use the following formula:
e.g: =IF(ISBLANK(B8&H8),"",B8&H8)
This formula works out great when im dealing with increasing amounts of data as I can simply drag the formula down as far as i want and i know that it will pick up the formula whenever I refresh the database without the need of seeing value errors when the formula ends up referring to a blank cell. The snag here (and my query as well) is if I have less data then before the formula within the last set of cells looks something like this:
e.g: =IF(ISBLANK(#REF!&#REF!),"",#REF!&#REF!)
I have dealt with #REF before in other spreadsheets whereby I simply used a ISERROR in the statement but I dont know if there is a possible way of including this within my formula. I need the ISBLANK there so I have more control and dont have to drag the formula as often.
If there is a better way around this or a way to amend the current formula Id appreciate the help :)
The only way you are going to get something like this:
=IF(ISBLANK(#REF!&#REF!),"",#REF!&#REF!)
in the formula bar is if you(or the system you are using) are somehow deleting the cells that were originally referenced. This should be avoidable. You can clear the cells referenced instead of deleting them completely - then you won't get this error - and your formulas will remain intact. Now you can certainly use the formulas provided in the comments to hide the errors - but the root of your problem seems to me to be that the errors are occuring in the first place. Good Luck.

Resources