Formula for lookup, sum if and date range

jhampel106

New Member
Joined
Oct 2, 2009
Messages
24
I am looking for someone who is proficient in formulas to help me out. I am trying to match a date range and total sums if the row falls between the date range. I want to do this as a formula, not a macro. My file has three worksheets. In worksheet 'PT', column E (Line Description) lists the beginning and ending date range, but it is in text format with other characters at the end of the line, but the first 6 characters will always be beginning date and characters 8-13 will always be the ending date. Worksheet 'names' cross references the common data that will match the other two worksheets. Worksheet 'UNIV' lists all the raw data that needs to be totaled. I would like to create a formula in worksheet 'PT' where it grabs every line in worksheet 'UNIV' that falls within the date range for that customer and total it in the highlighted cell G2. Can someone help me?
Here is a link to a screen print of what I am looking at.
https://www.dropbox.com/s/j7gwpkkdis...onK12%20EX.pdf

I have been trying to work on this for quite some time and can't work out the kinks for it to give me a sum total.
Thank you.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Give this one a shot:

=SUMIFS(UNIV!V:V,UNIV!B:B,INDEX(names!A:B,MATCH(PT!A2,names!A:A,0),2),UNIV!L:L,">="&DATE("20"&MID(E2,5,2),LEFT(E2,2),MID(E2,3,2)),UNIV!L:L,"<="&DATE("20"&MID(E2,12,2),MID(E2,8,2),MID(E2,10,2)))

I reconstructed the first few lines of your file based on the images. It returns -177.1 for the first entry on 'PT' (BeeBee Co., 7/29/13 - 8/5/13).

Note that I've hardcoded the "20" in the year part of the date formula, assuming that all your data occurs in this century. If there's stuff from before the year 2000 the formula will require minor adjustment to work properly.
 
Upvote 0
It works beautifully. I knew it could be done, and I have been working on this for a long time. Thank you for your help!
 
Upvote 0

Forum statistics

Threads
1,214,938
Messages
6,122,346
Members
449,080
Latest member
Armadillos

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