How to use Dsum with two criteria

sassriverrat

Well-known Member
Joined
Oct 4, 2018
Messages
655
Good Morning,

I have a current formula that I'm trying to modify. The below formula looks up and is supposed to add all numbers in a data set that meet between the dates specified in the two cells. However, I'd like to tweak this. Currently, in the data set, the Date is one column and the Time is another column. Ideally, I'd like to keep the data set that way. I'd like to add to my formula so that it would lookup and add all numbers in the data set between the dates and times.

So currently, Cell A1 is "Date", Cell B1 is "Date", Cell A2 is ">8/31/2019 and Cell B2 is "<=9/30/2019

I tried inputting a time into each of those two date cells above so it would read ">8/31/2019 12:00 PM" and the same for the other but it didn't work, presumably because the time is another column in the data set. How do I correct this? Yes, I'd like it to read all data from noon to noon from the last day of last month to the last day of this month. Thanks!

Code:
=DSUM('VOYAGE DATA'!$A:$CY,"ME MGO",A14:B15)
 
I can't seem to upload from the actual data set....I'm guessing too many cells?

But the headers are "date" and "time" in separate columns
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
bump, anyone?

Trying to use two headers when running a dsum piece... headers being "Date" and "Time" within the dataset and the lookup cell is formatted mmm-dd-yyyy hh:mm (so date and time combined....)

Can anyone help?
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,161
Members
453,021
Latest member
Justyna P

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