Complex - Multiple Criteria

dunmore83

Well-known Member
Joined
Aug 24, 2011
Messages
540

Excel 2012
BCDEFGHIJKLMNOPQ
2Ear TagSexNLISBirth Date01-Jul-1402-Jul-1403-Jul-1404-Jul-1405-Jul-1406-Jul-1407-Jul-1408-Jul-14
3
4
51658Heifer-04.09.1104-Sep-111,0311,0321,0331,0341,0351,0361,0371,038
62112Heifer98212349040565410.08.1210-Aug-12690691692693694695696697
7272Heifer98212349042566827.08.1227-Aug-12673674675676677678679680
82282Heifer98212349042575728.09.1228-Sep-12641642643644645646647648
93007Heifer98212349042517624.01.1324-Jan-13523524525526527528529530
103008Heifer98212349041793224.01.1324-Jan-13523524525526527528529530
113018Heifer98212349042585829.01.1329-Jan-13518519520521522523524525
123026Heifer98212349884756131.01.1331-Jan-13516517518519520521522523
133040Heifer98212349044906306.02.1306-Feb-13510511512513514515516517
143042Heifer98212349041773706.02.1306-Feb-13510511512513514515516517
153053Heifer98212349040556007.02.1307-Feb-13509510511512513514515516
163052Heifer98212349044912507.02.1307-Feb-13509510511512513514515516
173051Heifer98212348946245407.02.1307-Feb-13509510511512513514515516
183055Heifer98212349042596708.02.1308-Feb-13508509510511512513514515
193054Heifer98212349042584808.02.1308-Feb-13508509510511512513514515
203064Heifer98212349041751511.02.1311-Feb-13505506507508509510511512
213061Heifer98212349041970811.02.1311-Feb-13505506507508509510511512
223065Heifer98212349884768512.02.1312-Feb-13504505506507508509510511
233069Heifer98209101630871614.02.1314-Feb-13502503504505506507508509
243071Heifer98212349044781914.02.1314-Feb-13502503504505506507508509
253074Heifer98212349042503917.02.1317-Feb-13499500501502503504505506
263084Heifer98212349022669126.02.1326-Feb-13490491492493494495496497
273088Heifer98212349042514028.02.1328-Feb-13488489490491492493494495
283090Heifer98212348946404203.03.1303-Mar-13485486487488489490491492
293098Heifer98212348945935611.03.1311-Mar-13477478479480481482483484
303104Heifer98212348946636001.04.1301-Apr-13456457458459460461462463
313161Heifer98212349022404109.08.1309-Aug-13326327328329330331332333
323176Heifer98200019176311915.08.1315-Aug-13320321322323324325326327
333179Heifer98200019180582116.08.1316-Aug-13319320321322323324325326
343190Heifer98200019172751218.08.1318-Aug-13317318319320321322323324
353186Heifer98212349885183918.08.1318-Aug-13317318319320321322323324
363191Heifer98200019173670919.08.1319-Aug-13316317318319320321322323
ages-excel-forum
 
Also in the last file I sent I have tried to adjust your formulas to make it work for the preg column in the stock-reconc-heifers worksheet... however it doesn't seem to be quite working!!

For example there are 78 preg dates on 23-Mar-15 however the formula is only picking up 26. Any ideas??
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Thanks that's excellent.
One more thing... are you able to pinpoint why the closing balances from the Stock-Reconc.-Heifers worksheet is different to the Stock-Heifers-By-Age worksheet? As shown by the calculations in BC32 & BF32. Ideally I need these to be the same

Because you have gaps in your dates, you are not picking up data for July & Aug 2014.
Code:
[TABLE="width: 135"]
<tbody>[TR]
[TD]03-Jan-14[/TD]
[TD][/TD]
[TD][/TD]
[TD]03-Sep-14[/TD]
[TD][/TD]
[TD][/TD]
[TD]01-Mar-15[/TD]
[/TR]
[TR]
[TD]22-Apr-14[/TD]
[TD][/TD]
[TD][/TD]
[TD]29-Jan-15[/TD]
[TD][/TD]
[TD][/TD]
[TD]30-Jun-15[/TD]
[/TR]
</tbody>[/TABLE]

Same for the preg.
 
Last edited:
Upvote 0
I adjusted the group dates to make sure all the dates are incorporated in column K of the source data sheet... however still get a difference of 8!! Will keep looking into it.

I'm not sure the preg test formula is working.. for example there are 78 occurrences of 23-Mar-15 in the preg column AR. However my the preg column AT on the stock-reconc-heifers is only picking up 26.

If we look at AR244:AR296 there are 52 occurences of 23-Mar-15 for the 09-Aug-13 to 01-Oct-13 heifer group however it is only showing 22 for this month??
 
Upvote 0
I adjusted the group dates to make sure all the dates are incorporated in column K of the source data sheet... however still get a difference of 8!! Will keep looking into it.

I'm not sure the preg test formula is working.. for example there are 78 occurrences of 23-Mar-15 in the preg column AR. However my the preg column AT on the stock-reconc-heifers is only picking up 26.

If we look at AR244:AR296 there are 52 occurences of 23-Mar-15 for the 09-Aug-13 to 01-Oct-13 heifer group however it is only showing 22 for this month??

But, they are outside the dates 09-Aug-13 to 01-Oct-13.
 
Upvote 0
Also another one... J88 in the Livestock Sales is showing a birth date of 31-May-15. However it is actually 16-Sep-14 in the source data sheet. Any ideas?!!

THANKS!!!!!
 
Upvote 0
Had another quick look, some of the references have got mixed up!! I'll try & take a look later or tomorrow am.
 
Upvote 0
Taken quite a while to find and fix the problems, the formulas you copied and amended where a bit screwed up.

If you copy again, make sure that the 1st references the columns with the relevant dates (Preg, Sold etc.), the 2nd & 3rd references the Birth Dates.

=-SUMPRODUCT((TEXT('Stock-Source-Data'!$AR$10:$AR$1951,"mmyy")=TEXT($D20,"mmyy"))*('Stock-Source-Data'!$K$10:$K$1951>=$V$1)*('Stock-Source-Data'!$K$10:$K$1951<=$V$2)*('Stock-Source-Data'!$N$10:$N$1951=$AH$10)*('Stock-Source-Data'!$W$10:$W$1951=$AH$13))

The formulas are now correct (I hope!), suggest you sense check again, if data
appears missing double check the date ranges (Births are within selected dates).

Let me know........

Gaz

https://www.dropbox.com/s/fl0ccq78o1aofda/Gaz-Comparison.xlsx?dl=0
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,335
Members
452,636
Latest member
laura12345

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