MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 25th, 2002, 11:52 AM   #1
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

All,

I have the following type of data:

Part1

{"PROSPECT_NO","CREATION_DATE","STATE_CODE","PAY_METHOD","CONTRACT_TYPE","TITLE","FIRST_NAME","SURNAME","ADDRESS","AGBNT_ID","AGNET_NAME","CANCELLATION_DATE","CANCELLATION_REASON","HOW_THEY_CANCELLED";"SDTS0060036104",37274,"CANC","MDD","GAS","Mrs","Jane","Doe","2 Mystery Way, KT3 5ED","SIT00005","AGENT1",37280,"No reason given","Letter";"SDTS0060037925",37279,"CANC",0,"ELEC","Mr & Mrs","S","Madeup","12 Nowhere Street, TW135HY","SIT00008","AGENT2",37281,"Info only","Inbound call";"SDTS0060037925",37279,"CANC",0,"GAS","Mr & Mrs","S","Madeup","12 Nowhere Street, TW135HY","SIT00008","AGENT2",37281,"Info only","Inbound call";"SDTS0060037626",37278,"CANC","MDD","GAS","Mr","STEPHEN","NOT","76 As Above, OZ12 9SS","SIT00009","AGENT3",37281,"Customer changed mind","Inbound call"}

Part2

{"SDTS0060037412",37277,"CANC",0,"ELEC","Mr & Mrs","E","YOU","5 My Lane, ZZ26ZZ","SIT00008","AGENT4",37281,"Info only","Welcome call";"SDTS0060037412",37277,"CANC",0,"GAS","Mr & Mrs","E","YOU","5 My Lane, ZZ26ZZ","SIT00008","AGENT4",37281,"Info only","Welcome call";"SDTS0060042877",37279,"CANC",0,"ELEC","Mrs","IAN","MAC","13 Nearly There, NT104AR","SIT00008","AGENT2",37284,"Customer changed mind","Inbound call";"SDTS0060042877",37279,"CANC",0,"GAS","Mrs","IAN","MAC","13 Nearly There, NT104AR","SIT00008","AGENT2",37284,"Customer changed mind","Inbound call";"SDTS0060038094",37280,"CANC",0,"ELEC","Mrs","COMEON","EILEEN","63 Back Lane, BB5 3BB","SIT00001","AGENT1",37285,"Wants to remain with existing supplier","Inbound call"}

What I'd like is to have a formula that will count the entries using certain criteria BUT only unique Entries

SO, example expected results would be:

All Cancellations by agent2 = 2
All Cancellations on or before Jan 24 = 4

Any ideas??


__________________
"Have a good time......all the time"
Ian Mac
Ian Mac is offline   Reply With Quote
Old Mar 25th, 2002, 12:21 PM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
Default

Ian,

What makes a record with agent X unique?

What makes a record with a certain date unique?

Aladin

Aladin Akyurek is offline   Reply With Quote
Old Mar 25th, 2002, 12:38 PM   #3
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

Sorry for not explaining, I will probably test the PROSPECT_NO.

what it is going to be used for is cancellations of utilities sales, so if a person buy both gas and electricity it counts as only 1 Cancelation, the same as if they only bought gas or electricity, but only 1. In each case of a duel sale the PROSPECT_NO will be the same.

i.e. if any formula proposed finds a duplicate PROSPECT_NO then deduct that extra one from the findings.
__________________
"Have a good time......all the time"
Ian Mac
Ian Mac is offline   Reply With Quote
Old Mar 25th, 2002, 01:16 PM   #4
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
Default

Quote:
On 2002-03-25 11:38, Ian Mac wrote:
Sorry for not explaining, I will probably test the PROSPECT_NO.

what it is going to be used for is cancellations of utilities sales, so if a person buy both gas and electricity it counts as only 1 Cancelation, the same as if they only bought gas or electricity, but only 1. In each case of a duel sale the PROSPECT_NO will be the same.

i.e. if any formula proposed finds a duplicate PROSPECT_NO then deduct that extra one from the findings.
Ian,

What follows assumes that CANCELLATION_DATE is blank when a utilities sales is not cancelled.

Array-enter in order to answer the query All Cancellations by agent2:

=SUM(IF((K8:K16="AGENT2")*(LEN(L8:L16)>0),1/COUNTIF(A8:A16,A8:A16)))

where K8:K16 houses AGENT_NAMEs, L8:L16 CANCELLATION_DATEs, and A8:A16 PROSPECT_NOs.

This gives me indeed 2 for AGENT2.

Array-enter in order to answer the query All Cancellations on or before Jan 24:

=SUM(IF(L8:L16<="24-Jan-02"+0,1/COUNTIF(A8:A16,A8:A16)))

where ranges are as described above.

This gives me 1, because there is only one cancellation date that meets the condition <= 24-Jan-02. All other dates are later than this criterion date.

You could also try set up Advanced Filter or use database functions to answer the above queries.

Use also dynamically computed ranges (I guess you do that already for dynamically changing data areas).

Regards,

Aladin

[ This Message was edited by: Aladin Akyurek on 2002-03-26 01:38 ]
Aladin Akyurek is offline   Reply With Quote
Old Mar 26th, 2002, 02:59 AM   #5
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

Quote:
On 2002-03-25 12:16, Aladin Akyurek wrote:

Ian,

What follows assumes that CANCELLATION_DATE is blank when a utilities sales is not cancelled.

Array-enter in order to answer the query All Cancellations by agent2:

=SUM(IF((K8:K16="AGENT2")*(LEN(L8:L16)>0),1/COUNTIF(A8:A16,A8:A16)))

where K8:K16 houses AGENT_NAMEs, L8:L16 CANCELLATION_DATEs, and A8:A16 PROSPECT_NOs.

This gives me indeed 2 for AGENT2.

Array-enter in order to answer the query All Cancellations on or before Jan 24:

=SUM(IF(L8:L16<="24-Jan-02"+0,1/COUNTIF(A8:A16,A8:A16)))

where ranges are as described above.

This gives me 1, because there is only one cancellation date that meets the condition <= 24-Jan-02. All other dates are later than this criterion date.

You could also try set up Advanced Filter or use database functions to answer the above queries.

Use also dynamically computed ranges (I guess you do that already for dynamically changing data areas).

Regards,

Aladin

[ This Message was edited by: Aladin Akyurek on 2002-03-26 01:38 ]
But of course! (didn't even think of just using the COUNTIF() in there with any other criteria), Thanks VERY much again, I adapted the first one as the list in question is JUST cancellations therefore no need to eliminate blanks (will use it elsewhere I'm sure).

I thought you may have came back with a SUMPRODUCT() answer as you seem to have moved away from CSE formulas as and when possible (I assume it wasn't).

Many thanks again,
__________________
"Have a good time......all the time"
Ian Mac
Ian Mac is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 09:13 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes