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 11th, 2002, 02:17 PM   #1
rs008f
New Member
 
Join Date: Mar 2002
Location: Rochetser, NY
Posts: 7
Default

Below is an example of my spreadsheet.

Time 0 months (time required for profits to be earned)
Month 1 2 3 4 5 6 7 8 9 10 11 12
Profits($)10 20 30 40 50 60 70 80 90 100 110 120

My situation is as follows:
The profits depends of Time. If it is 5 months, then all the profits will be shited 5 months later; $10 would be appear under Month 6 and so on. Changing the # of Months will automatically shift the profits back and forth. What formula or tricks should I use to attain this. I tried using the IF function but it's too tedious and wasn't successful as it only allows 7 levels whereas there are 12 months(13 possibilities) in a year. Any advise would be great.
rs008f is offline   Reply With Quote
Old Mar 11th, 2002, 02:35 PM   #2
Steve Hartman
Board Regular
 
Steve Hartman's Avatar
 
Join Date: Feb 2002
Location: Houston,Texas
Posts: 418
Default

Quote:
On 2002-03-11 13:17, rs008f wrote:
Below is an example of my spreadsheet.

Time 0 months (time required for profits to be earned)
Month 1 2 3 4 5 6 7 8 9 10 11 12
Profits($)10 20 30 40 50 60 70 80 90 100 110 120

My situation is as follows:
The profits depends of Time. If it is 5 months, then all the profits will be shited 5 months later; $10 would be appear under Month 6 and so on. Changing the # of Months will automatically shift the profits back and forth. What formula or tricks should I use to attain this. I tried using the IF function but it's too tedious and wasn't successful as it only allows 7 levels whereas there are 12 months(13 possibilities) in a year. Any advise would be great.
Let's do some assuming:

We're going to put the time month in A1 (5 in your ex)
Your month row is in row 2
Your profit is in row 3
put this formula in A3, =(A2-$A$1)*10 and copy down the row. Then use conditional formatting to change the font color to the background color whenever the cell is less than or = to 0. your profit values will "slide" down the scale depending on what value youo put in A1.


[ This Message was edited by: Steve Hartman on 2002-03-11 13:36 ]

[ This Message was edited by: Steve Hartman on 2002-03-11 13:41 ]

[ This Message was edited by: Steve Hartman on 2002-03-11 14:22 ]
Steve Hartman is offline   Reply With Quote
Old Mar 12th, 2002, 11:23 AM   #3
rs008f
New Member
 
Join Date: Mar 2002
Location: Rochetser, NY
Posts: 7
Default

What if the profits don't have a pattern? Like random numbers, this won't work as I have analyzed. Is there another way?
rs008f is offline   Reply With Quote
Old Mar 12th, 2002, 11:29 AM   #4
Steve Hartman
Board Regular
 
Steve Hartman's Avatar
 
Join Date: Feb 2002
Location: Houston,Texas
Posts: 418
Default

Then why did you use an example with a pattern!?!?

Post some REAL data that has SOMETHING to do with what you REALLY want.
Steve Hartman is offline   Reply With Quote
Old Mar 12th, 2002, 12:22 PM   #5
NateO
Legend
 
NateO's Avatar
 
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
Default

How's this trickery:

If Time is in B1, months are in b2:m2 and profits are in b3:m3. Cells b4:m4 are time-adjusted profits.

In cell b4 put:

=IF(B1=1,B3,0)

In cell c4 put:

=IF(B4>0,INDEX($B$3:$M$3,MATCH(B4,$B$3:$M$3,0)+1),IF(C2=$B$1,$B$3,0))

Copy c4 to d4:m4. Works for me, if I understand the question correctly.

Cheers,

Nate

P.S. - Holy rules by Chip! Feel like I'm back at boarding school!

[ This Message was edited by: nateo on 2002-03-12 12:36 ]
NateO is offline   Reply With Quote
Old Mar 12th, 2002, 12:43 PM   #6
NateO
Legend
 
NateO's Avatar
 
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
Default

I suppose you want a one month lag, if so, try this trickery:

If Time is in B1, months are in b2:m2 and profits are in b3:m3. Cells b4:m4 are time-adjusted profits.

In cell b4 put:

=IF(B1=0,B3,0)

In cell c4 put:

=IF(B4>0,INDEX($B$3:$M$3,MATCH(B4,$B$3:$M$3,0)+1),IF(C2-1=$B$1,$B$3,0))

Copy c4 to d4:m4. Hope this helps.

Cheers,

Nate

[ This Message was edited by: NateO on 2002-03-12 12:37 ]
NateO is offline   Reply With Quote
Old Mar 12th, 2002, 01:55 PM   #7
NateO
Legend
 
NateO's Avatar
 
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
Default

Sorry rsf008f, my last trickery doesn't work so well if you have the same value sporadically placed throughout your timeline. I think the following trickery will:

If Time is in B1, months are in b2:m2 and profits are in b3:m3. Cells b4:m4 are time-adjusted profits.

In cell b4 put:

=IF(B1=0,B3,0)

In cell c4 put:

=IF(B4>0,INDEX($B$3:$M$3,COUNTIF($B$4:B4,"<>0")+1),IF(C2-1=$B$1,$B$3,0))

Copy c4 to d4:m4. Hope this helps.

Sorry about the goof. Cheers,

Nate
NateO is offline   Reply With Quote
Old Mar 12th, 2002, 02:36 PM   #8
rs008f
New Member
 
Join Date: Mar 2002
Location: Rochetser, NY
Posts: 7
Default

The last part works flawlessly. Thanks for helping me out. The combination you came up with, I wouldn't have figured it out. Do you know an Excel book that teaches this kind of techniques/tricks? I have the Microsoft Excel Book but it's like an extended help file, no much in combining such functions. Or is it only by experience can it be learnt?
rs008f is offline   Reply With Quote
Old Mar 12th, 2002, 02:40 PM   #9
NateO
Legend
 
NateO's Avatar
 
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
Default

RS008,

That's excellent! My experience is based on experience and my need to play around with code and formulae. The internet's a good source (I've learned quite a bit from the good folks on this board), Jim Walkenbach might have some more advanced, practical books: http://j-walk.com/ss/books/xlbooks.htm
It appears Mr. Excel agrees: http://www.mrexcel.com/book.shtml These are mostly books by Jimmy. Like most things in life, I find no matter how much I read, I won't retain it unless I apply it...

Happy Hunting. Cheers,

Nate

[ This Message was edited by: nateo on 2002-03-12 14:29 ]
NateO 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 04:37 AM.


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