Amit, If you are looking to count unique Vehicles in a date & a period. here is one way:
For a single date: =SUM(IF(FREQUENCY(IF(TEXT(H$4:H$9,"mdyyyy")=TEXT(CabOutDate,"mdyyyy"),IF(C$4:C$9<>"",MATCH(C$4:C$9,C$4:C$9,0))),ROW(C$4:C$9)-ROW(C$4)+1),1)) Change cabOutDate to your reference where is the lookup date entered. For the period: =SUM(IF(FREQUENCY(IF(H$4:H$9>=StartDate,IF(H$4:H$9<EndDate+1,IF(C$4:C$9<>"",MATCH(C$4:C$9,C$4:C$9,0)))),ROW(C$4:C$9)-ROW(C$4)+1),1)) Change StartDate & EndDate with your cell reference where is the lookup dates entered. Both these are Array Formulas, so must hit *CTRL+SHIFT+ENTER*, rather than just ENTER. Also better to use TEXT function, if you have text in column H like N/A, NONE or something. INT will give you an error if there is any text. See the attached. __________ HTH, Haseeb -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com
Unique_Cab_Count.xls
Description: MS-Excel spreadsheet