Returning Multiple values based on 3 different criteria

ncmgamecock

New Member
Joined
May 2, 2011
Messages
2
Hi...

I am a bit confused as how to even begin. I believe a match or index function will work, but i'm just not sure how to make it work.

First, I have a spreadsheet (master data) that pulls from an access database. The data goes back to 2006, and is updated whenever i hit refresh. This data is constantly being updated by over 300 employees. the reason i have this linked to excel, is that it is currently only about 40000 lines (so very manageable).

Second, what i am trying to do is compile various totals from this data set based on several sets of criteria ( i am currently using various sets of pivot tables, but i am now looking for specific criteria to send out in a "tally" fashion). The criteria will be based on Account Director, Target Date, Original Target Date, and Status.

As an example (that i can base other formulas off of), i would need to base the Account Director (in sheet 2, or my final list) to the "master Data" (found in sheet 1, where there is an account director column) set....then find a target date between 3/1/2011 and 3/31/2011...then with a status of "AD Hold"....each set of criteria is in their own column....

I am happy to provide more information.

Thank you in advance for any assistance you can provide!!!!

 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi,

Sample data......


Excel Workbook
ABCDEF
1NameDate1AnimalTransportDate2ID Number
2tom01/01/2010CowBike01/01/2011AA10000
3****02/01/2010dogCar02/01/2011AA10001
4Harry03/01/2010HorseBus03/01/2011AA10002
5Sally04/01/2010Mousetrain04/01/2011AA10003
6Mary05/01/2010fishTram05/01/2011AA10004
7Tom06/01/2010CowPlane01/01/2011AA10005
8Jill07/01/2010PandaTut Tut07/01/2011AA10006
9Jo08/01/2010TigerCoach08/01/2011AA10007
10Joe09/01/2010LionCarriage09/01/2011AA10008
11tom01/01/2010CowBoat10/01/2011AA10009
12Stan11/01/2010cowtrike01/01/2011AA10010
13tom01/01/2010cowBus01/01/2011AA10011
14Dom13/01/2010dogCar13/01/2011AA10008
15Harry14/01/2010HorseBus04/01/2011AA10000
Sheet1


Results using Mike's formula method...

Excel Workbook
ABCDEF
1Criteria***Count*
2NameDate1AnimalDate23*
3Tom01/01/2010Cow01/01/2011**
4******
5NameDate1AnimalTransportDate2ID Number
6tom01/01/2010CowBike01/01/2011AA10000
7Tom06/01/2010CowPlane01/01/2011AA10005
8tom01/01/2010cowBus01/01/2011AA10011
Sheet2


The formula in A6 needs to be entered with ctrl shift enter NOT enter.
You can then copy it across and down to suit.

Is this what you would like to do?

Ak
 
Upvote 0
Wow thank you both for your suggestions!!

I was able to successfully use the formula: =SUMPRODUCT((Sheet2!$H$2:$H$80125>=DATE(2011,3,7))*(Sheet2!$H$2:$H$80125<=DATE(2011,4,29))*((Sheet2!$K$2:$K$80125=$A10)*(Sheet2!$AI$2:$AI$80125=$Z$8)))

This formula is able to return the number of "contracts" that meet the criteria specified within the formula. Is there a way i can also find the total dollars associated with these contracts (by adding to this formula)? It would have the same criteria, but utilize columns R and AH to find total contract value.

Thanks in advance for your help!!
 
Upvote 0
Hi,

With my limited skills and without seeing a sample of your data it is difficult for me to give you the correct solution, you could try this in A6 of Sheet1...

=IF(ROWS(A$6:A6)>$E$2,"",INDEX(Sheet1!R$2:R$80125,SMALL(IF((Sheet2!$H$2:$H$80125>=Date(2011,3,7))*(Sheet2!$H$2:$H$80125<=Date(2011,4,29))*(Sheet2!$K$2:$K$80125=$A$10)*(Sheet2!$AI$2:$AI$80125<=$Z$8),ROW(Sheet2!$R$2:$R$80124)-ROW(Sheet2!$A$2)+1),ROWS(A$6:A6))))

Enter with ctrl shift enter NOT enter.

This formula is based on your Sumproduct result being in E2 of sheet1.

You can try this formula in B6 of sheet1.....

=IF(ROWS(B$6:B6)>$E$2,"",INDEX(Sheet1!AH$2:AH$80125,SMALL(IF((Sheet2!$H$2:$H$80125>=Date(2011,3,7))*(Sheet2!$H$2:$H$80125<=Date(2011,4,29))*(Sheet2!$K$2:$K$80125=$A$10)*(Sheet2!$AI$2:$AI$80125<=$Z$8),ROW(Sheet2!$R$2:$R$80124)-ROW(Sheet2!$A$2)+1),ROWS(B$6:B6))))

Again enter with ctrlt shift enter NOT enter.

Hopefully the above formulas will return all the amounts in R & AH that meet your criteria.

One point that I would like to make about your Sumproduct formula, and I'm no expert so my opinion could be invalid here, I would use a cell reference rather than use......
(Sheet2!$H$2:$H$80125>=Date(2011,3,7))
(Sheet2!$H$2:$H$80125<=Date(2011,4,29))

Example
Sheet2!$H$2:$H$80125>=$A$1)
Sheet2!$H$2:$H$80125<=$A$2)

This will offer you more flexibility, if you want a different date range you will have to change your formula every time, with a cell reference you just type the new criteria into the cell.

I hope that this helps, but it is difficult for me without sample data to work with.

Ak
 
Upvote 0
Hi,

Using my sample data...


Excel Workbook
ABCDEF
1NameDate1AnimalTransportDate2Amount
2tom01/01/2010CowBike01/01/20112,000
3****02/01/2010dogCar02/01/2011200
4Harry03/01/2010HorseBus03/01/20112,000
5Sally04/01/2010Mousetrain04/01/2011200
6Mary05/01/2010fishTram05/01/2011200
7Tom06/01/2010CowPlane01/01/201120,000
8Jill07/01/2010PandaTut Tut07/01/2011200
9Jo08/01/2010TigerCoach08/01/2011200
10Joe09/01/2010LionCarriage09/01/2011200
11tom01/01/2010CowBoat10/01/201120,000
12Stan11/01/2010cowtrike01/01/20112,000
13tom01/01/2010cowBus01/01/20112,000
14Dom13/01/2010dogCar13/01/2011200
Sheet1


You can either return the values individually and sum them in F3, or change your sumproduct formula as in F2....

Excel Workbook
ABCDEF
1Criteria***CountTotal Amount
2NameDate1AnimalDate2324,000
3Tom01/01/2010Cow01/01/2011*24,000
4******
5NameDate1AnimalTransportDate2Amount
6tom01/01/2010CowBike01/01/20112,000
7Tom06/01/2010CowPlane01/01/201120,000
8tom01/01/2010cowBus01/01/20112,000
Sheet2


I hope that solves it for you.

Ak
 
Upvote 0

Forum statistics

Threads
1,224,588
Messages
6,179,743
Members
452,940
Latest member
rootytrip

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