Unique List - Mechanics Shop

cpa2838

New Member
Joined
Apr 28, 2015
Messages
5
Hi All,
First, thanks to all that help and post to the forums. I hope someone is able to help me as well. I'm using a mechanic's shop as an example because it is a simple representation of what I'm trying to achieve. I want to pull a unique list of vehicle models that visited the shop within a date range and by vehicle type.
1ABCDEF
2ModelTypeDate InDate OutDesired List
3F150Truck4/1/20154/5/2015F150
4TaurusCar4/2/20154/4/2015C1500
5MalibuCar4/3/20154/4/2015F250
6C1500Truck4/5/20154/8/2015
7AccordCar4/7/20154/8/2015
8F250Truck4/7/20154/9/2015
9C2500Truck4/7/20154/12/2015
10
11Report Date Range4/1/20154/9/2015

<tbody>
</tbody>
My formula attempt resembles this: =INDEX($A$2:$A$9,MATCH(1,($C$2:$C$9>=C11)*($D$2:$D$9<=D11)*($B$2:$B$9="Truck"),0)). It results with the F150 but if I drag it to other cells they all result in F150. In this example, the desired list is in the same worksheet but in my actual file the data is in another worksheet. I am familiar with how to reference another worksheet so that part shouldn't be a problem. I'm currently using Excel 2007.
It seems that I may be missing a COUNTIF statement but I'm not sure. Any help offered will be greatly appreciated!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
This is an array formula and must be entered with CTRL-SHIFT-ENTER.
Copy formula down as needed.
Excel Workbook
ABCDEFG
1ModelTypeDate InDate OutDesired List
2F150Truck4/1/20154/5/2015F150
3TaurusCar4/2/20154/4/2015C1500
4MalibuCar4/3/20154/4/2015F250
5C1500Truck4/5/20154/8/2015
6AccordCar4/7/20154/8/2015
7F250Truck4/7/20154/9/2015
8C2500Truck4/7/20154/12/2015
9
10
11Report Date Range4/1/20154/9/2015
12
Sheet
 
Upvote 0
You're welcome. Thanks for the feedback. We're using the ROW function to return the row numbers that match your criteria.
In this example
IF($C$2:$C$9>=$C$11,IF($D$2:$D$9<=$D$11,IF($B$2:$B$9="Truck",ROW($B$2:$B$9)-ROW($B$2)+1))) returns
{1;FALSE;FALSE;4;FALSE;6;FALSE;FALSE}
 
Upvote 0
AhoyNC, sorry to bother you again but if I wanted to add another criteria, say in column E for engine size, would that be another IF statement before the ROW functions? And thanks for the insight on the ROW function!!
 
Upvote 0
Yes it would.
Excel Workbook
ABCDEFG
1ModelTypeDate InDate OutEng.Desired List
2F150Truck4/1/20154/5/2015V8F150
3TaurusCar4/2/20154/4/20154 cylF250
4MalibuCar4/3/20154/4/2015V6
5C1500Truck4/5/20154/8/2015V6
6AccordCar4/7/20154/8/20154 cyl
7F250Truck4/7/20154/9/2015V8
8C2500Truck4/7/20154/12/2015V6
9
10
11Report Date Range4/1/20154/9/2015
Sheet
 
Upvote 0
Perfect AhoyNC! Thanks again for your time and consideration in helping me. I did discover one thing and it is probably due to the way I worded my request for help. If, for instance, the F150 visits the shop again the formula will show it again which means the list would not be truly unique. But, I'm thinking this will be ok because that may be best for my report. Thanks a million!
 
Upvote 0
This should give you a unique list.
This link should help explain the formula. Also, if you have a large worksheet the IFERROR can slow things down. If that becomes an issue you might want to look at how he uses the SUMPRODUCT to count records and use the count to keep from having an #NA where there are no records.

https://www.youtube.com/watch?v=DLgnhPSOEOw
Excel Workbook
ABCDEFG
1ModelTypeDate InDate OutEng.Desired List
2F150Truck4/1/154/5/15V8F150
3TaurusCar4/2/154/4/154 cylF250
4MalibuCar4/3/154/4/15V6
5C1500Truck4/5/154/8/15V6
6AccordCar4/7/154/8/154 cyl
7F250Truck4/7/154/9/15V8
8C2500Truck4/7/154/12/15V6
9F150Truck4/6/154/7/15V8
10
11Report Date Range4/1/154/9/15
12
Sheet
 
Upvote 0
Thank you AhoyNC. The file will probably have about 5000 rows by the end of the year and then start fresh for the next year. I will monitor the speed as it builds. I watched the video and it does a great job of building the array formula with explanations. I will probably watch it a few more times in addition to some of the others he has. Thank you again for all your help on this, I sincerely appreciate it!
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

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