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 Apr 15th, 2002, 11:47 AM   #1
Anx
New Member
 
Join Date: Mar 2002
Posts: 22
Default

I have this formula where if a cell has the word refurbished in it then a calculation is performed...

e.g.

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19)

What i need to do is add a 'what if' the cell has the word "new" in it instead of refurbished and perform a different calculation, is it possible to add this to the existing formula please?


Also i need some help with dates....

How is it possible to work out how many months old date x is from a certain variable date y ?

e.g. I have a list of dates and need to work out how many months ago they are from another variable date.


Thanks for your help

Anx
Anx is offline   Reply With Quote
Old Apr 15th, 2002, 11:56 AM   #2
eliW
Board Regular
 
eliW's Avatar
 
Join Date: Mar 2002
Posts: 1,805
Default

Quote:
On 2002-04-15 10:47, Anx wrote:
I have this formula where if a cell has the word refurbished in it then a calculation is performed...

e.g.

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19)

What i need to do is add a 'what if' the cell has the word "new" in it instead of refurbished and perform a different calculation, is it possible to add this to the existing formula please?

Anx,
To the first part of your question:

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19,IF(H6="new",[enter your formula],""))

Eli


[ This Message was edited by: eliW on 2002-04-15 11:18 ]
eliW is offline   Reply With Quote
Old Apr 15th, 2002, 11:56 AM   #3
jfuoti
New Member
 
Join Date: Mar 2002
Posts: 48
Default

What you need is a nested if:

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19, IF(cell = "New", formula, ""))

As for the date simply use the minus function: date1 - date2, this will give you the number of days between dates
jfuoti is offline   Reply With Quote
Old Apr 15th, 2002, 12:04 PM   #4
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

the formula:

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19)

is currently incomplete, IF() being:

IF(logical_test,value_if_true,value_if_false)

so you can modify your formula to:

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19,IF(H6="New",Your_Calc,"")).

the "" tells excel to put NOTHING in the cell if the second if statment's argument is false.

Look at the help files for NESTED IF().

The second question you ask is a little more tricky, it depends on what you define as a month.

does it include part months? i.e. 6months 29days = 7 months
or does it not? 6months 29days = 6 months
would you like to include .something of a month?
do you need to round up or down from a given day in a month?
__________________
"Have a good time......all the time"
Ian Mac
Ian Mac is offline   Reply With Quote
Old Apr 15th, 2002, 12:05 PM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-04-15 10:47, Anx wrote:
I have this formula where if a cell has the word refurbished in it then a calculation is performed...

e.g.

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19)

What i need to do is add a 'what if' the cell has the word "new" in it instead of refurbished and perform a different calculation, is it possible to add this to the existing formula please?


Also i need some help with dates....

How is it possible to work out how many months old date x is from a certain variable date y ?

e.g. I have a list of dates and need to work out how many months ago they are from another variable date.


Thanks for your help [img]/board/images/smiles/icon_smile.gif[/img]

Anx
Gee Anx. Why start another thread? Now I've lost the connection, because I cannot do a Topic Review as easily.

You can change

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19)

to:

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19,IF(H6="New",another-calc-here,"?"))

You "need" to fill in for "?" when H6 is not "Refurbish" or "New".

The date question:

=MONTH(B1)-MONTH(A1)

where A1 and B1 houses properly formatted dates and A1 is earlier than B1.

Aladin

[ This Message was edited by: Aladin Akyurek on 2002-04-15 11:06 ]
Aladin Akyurek is offline   Reply With Quote
Old Apr 15th, 2002, 12:14 PM   #6
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

Quote:
On 2002-04-15 11:05, Aladin Akyurek wrote:
Quote:
On 2002-04-15 10:47, Anx wrote:
I have this formula where if a cell has the word refurbished in it then a calculation is performed...

e.g.

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19)

What i need to do is add a 'what if' the cell has the word "new" in it instead of refurbished and perform a different calculation, is it possible to add this to the existing formula please?


Also i need some help with dates....

How is it possible to work out how many months old date x is from a certain variable date y ?

e.g. I have a list of dates and need to work out how many months ago they are from another variable date.


Thanks for your help

Anx
Gee Anx. Why start another thread? Now I've lost the connection, because I cannot do a Topic Review as easily.

You can change

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19)

to:

=IF(H6="Refurbish",J6/100*'USER SHEET'!C19,IF(H6="New",another-calc-here,"?"))

You "need" to fill in for "?" when H6 is not "Refurbish" or "New".

The date question:

=MONTH(B1)-MONTH(A1)

where A1 and B1 houses properly formatted dates and A1 is earlier than B1.

Aladin

[ This Message was edited by: Aladin Akyurek on 2002-04-15 11:06 ]
I had thought of =MONTH(B1)-MONTH(A1)

but I thought I'd ask the questions, the only thing that it won't take into account is going from 1 year to the next.

however:

=((YEAR(B1)-YEAR(A1))*12)+(MONTH(B1)-MONTH(A1)) _Format as General

should accommodate this.

thoughts?

_________________
Share the wealth!!
Ian Mac

[ This Message was edited by: Ian Mac on 2002-04-15 11:15 ]
Ian Mac is offline   Reply With Quote
Old Apr 15th, 2002, 12:46 PM   #7
Anx
New Member
 
Join Date: Mar 2002
Posts: 22
Default

Excellent thanks, i now have..

=IF(H14="Refurbish",J14/100*'USER SHEET'!C19,IF(H14="New",J14*1,""))

the J14*1 is just to copy the data across if cell H14=new, I'm not sure this is the 'right' way to do this but it works.

Just one slight problem...when I auto-fill the line below (around 600 odd) the 'USER SHEET'C19 changes as well, ...going to 20 on the next line and 21 on the next etc etc.

Is there a way to stop this please? I only need them to reference C19 whilst for all the other cell references auto copying is fine..

Thanks

(sorry about the 2nd thread)

Anx


[ This Message was edited by: Anx on 2002-04-15 11:47 ]
Anx is offline   Reply With Quote
Old Apr 15th, 2002, 12:58 PM   #8
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Just freeze that changing bit: all it needs is 2 $$ :

'USER SHEET'!$C$9

Aladin

[ This Message was edited by: Aladin Akyurek on 2002-04-15 11:59 ]
Aladin Akyurek is offline   Reply With Quote
Old Apr 15th, 2002, 01:54 PM   #9
Anx
New Member
 
Join Date: Mar 2002
Posts: 22
Default

Hi, this doesnt seem to work, it gives me incorrect calculations now.

Anx
Anx is offline   Reply With Quote
Old Apr 15th, 2002, 04:42 PM   #10
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-04-15 12:54, Anx wrote:
Hi, this doesnt seem to work, it gives me incorrect calculations now.

Anx
How do you mean? You wanted to keep this unchanged while copying down the formula of which it is a part. Maybe the whole formula itself is not doing what you expect it to do. Maybe you should post the complete formula that you're dragging down.

Aladin

Aladin Akyurek 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 07:46 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