I'm having a really annoying issue with DSUM and I'm hoping I'm just misunderstanding something. A quick background:
I've built a financial distribution model in Open Office Calc. Since most of my colleagues work in Excel, I've exported the format to Microsoft's version. Everything is working fine apart from how DSUM behaves. Part of the raw data for the calculation is a sheet with the population numbers for a large number of cities. As part of working with the model, users need to enter what cities they want to include in a particular calculation. The way I built it in Open Office is nothing flashy or elegant, but it gets the job done: I have a DSUM, that picks data from the big list of cities. Since I don't know exactly how many cities people will want to include, I've included a number of extra rows in the criteria table. When a user enter a city in the designated table, this gets transplanted to the criteria table and DSUM returns what I would expect: The total population of the cities the user wanted.
But when I change to Excel, Microsoft ruins everything.
Turns out, when DSUM in Excel encounters a blank cell in the criteria table it just shrugs its metaphorical shoulders and sums everything in the data table. I know this, because if I manually change the criteria table to only include rows that have cities entered into them, it returns the correct total. But as soon as I extend the critera table to an empty row, I might as well not include any criteria at all because DSUM just sums up the populations of all the cities in the data table.
So my question is: Is there any way around this? So if my critera table runs from row 1 to 5 and I have cities entered into four of the rows, is there any way to make Excel understand that I in fact only want the populations of those four cities summed up?
Any advice would be greatly appreciated!
Bookmarks