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 Feb 28th, 2002, 09:31 PM   #1
Brian from Maui
Board Regular
 
Brian from Maui's Avatar
 
Join Date: Feb 2002
Posts: 7,743
Default

Aloha,

I would like to count these events as 1. Lost again

d1-c1>30
c1>a1
d1>b1

Mahalo
Brian from Maui is offline   Reply With Quote
Old Feb 28th, 2002, 09:46 PM   #2
Derek
Board Regular
 
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
Default

Hi
I assume you are looking for an If statement.

=IF(AND(D1-C1>30,C1>A1,C1>A1), "true", "false")

Replace "true" with what you want to see in the cell if its true.
Replace "false" with what you want to see in your cell if its false

Hope this is what you are looking for
Derek
Derek is offline   Reply With Quote
Old Feb 28th, 2002, 09:54 PM   #3
Brian from Maui
Board Regular
 
Brian from Maui's Avatar
 
Join Date: Feb 2002
Posts: 7,743
Default

Derek,

Not quite. I have time values in ABCD

10:00 10:40 10:10 10:41

It meets the criteria, but doesn't count as 1

Mahalo
Brian from Maui is offline   Reply With Quote
Old Feb 28th, 2002, 10:07 PM   #4
anno
Board Regular
 
Join Date: Feb 2002
Posts: 202
Default

question - if you have time values in the cells, how will D1-C1>30 ever be true? am i missing something? do you have dates as well?
anno is offline   Reply With Quote
Old Feb 28th, 2002, 10:23 PM   #5
Brian from Maui
Board Regular
 
Brian from Maui's Avatar
 
Join Date: Feb 2002
Posts: 7,743
Default

d1-c1 is 31 mins
Brian from Maui is offline   Reply With Quote
Old Feb 28th, 2002, 10:25 PM   #6
anno
Board Regular
 
Join Date: Feb 2002
Posts: 202
Default

oh, i see. i thought it would count that as .517. have never been good with time formats...thanks
anno is offline   Reply With Quote
Old Feb 28th, 2002, 10:37 PM   #7
anno
Board Regular
 
Join Date: Feb 2002
Posts: 202
Default

hang on. =D1-31 returns .31, not 31, so you will have amend the test condition from 30 to .30 (or will it be .5?)
anno is offline   Reply With Quote
Old Feb 28th, 2002, 10:43 PM   #8
Brian from Maui
Board Regular
 
Brian from Maui's Avatar
 
Join Date: Feb 2002
Posts: 7,743
Default

I tried formatting target cell to number, general, and time..no go. changed 31 to .31 and :31 doesn't count it ..
Brian from Maui is offline   Reply With Quote
Old Mar 1st, 2002, 01:34 AM   #9
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,314
Default

Quote:
On 2002-02-28 20:31, Brian from Maui wrote:
Aloha,

I would like to count these events as 1. Lost again

d1-c1>30
c1>a1
d1>b1

Mahalo
Brian,

Consider the following sample, where the funny numbers are Excel's internal representation of actual times,

{0.416666666666667,0.444444444444444,0.423611111111111,0.445138888888889;
0.40625,0.427083333333333,0.409722222222222,0.430555555555556;
0.427083333333333,0.447916666666667,0.430555555555556,0.456944444444444}

in A1:D3.

In E1 enter & copy down:

=((D1-C1)*1440>30)*(C1>A1)*(D1>B1)

You can then sum column E to get desired count:

=SUM(E:E)

or

=SUM(E1:E3)

However, you can also arrive at the desired count by means of a single formula:

In F1 enter:

=SUMPRODUCT(((D1:D3-C1:C3)*1440>30)*(C1:C3>A1:A3)*(D1:D3>B1:B3))

Aladin

[ This Message was edited by: Aladin Akyurek on 2002-03-01 00:35 ]
Aladin Akyurek is offline   Reply With Quote
Old Mar 1st, 2002, 01:56 AM   #10
Brian from Maui
Board Regular
 
Brian from Maui's Avatar
 
Join Date: Feb 2002
Posts: 7,743
Default

Aladin,

"AWESOME"



Did you read my funny story?
Brian from Maui 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 08:33 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