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 May 21st, 2002, 10:09 AM   #1
sci'01
New Member
 
Join Date: May 2002
Posts: 2
Default

I have a series of data that make up number of waves (it is time series data). What to do it take the maximum and minimum values of each wave (ie local max/min) and calculate and average max and min for the data set.

Any help would be much appreciated
sci'01 is offline   Reply With Quote
Old May 21st, 2002, 03:06 PM   #2
eliW
Board Regular
 
eliW's Avatar
 
Join Date: Mar 2002
Posts: 1,805
Default

Quote:
On 2002-05-21 09:09, sci'01 wrote:
I have a series of data that make up number of waves (it is time series data). What to do it take the maximum and minimum values of each wave (ie local max/min) and calculate and average max and min for the data set.

Any help would be much appreciated
Hi,
Try this sample by entering the formulas shown in D3 and E3 into B3 and C3 and copy down. Hope that it make sense.
Eli
Microsoft Excel - LocalMaxMin.xls_______________Running: xl97 : OS = Windows (32-bit) 4.10
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
E1=MAX
ABCDE
1DATAMINMAXMINMAX
22
31:alert("=IF(AND(SIGN(A4-A3)%3E=0,SIGN(A3-A2)%3C0),A3,"")")> :alert("=IF(AND(SIGN(A4-A3)%3C0,SIGN(A3-A2)%3E=0),A3,"")")> IF(AND(SIGN(A4-A3)>=0,SIGN(A3-A2)<0),A3,"")IF(AND(SIGN(A4-A3)<0,SIGN(A3-A2)>=0),A3,"")
40:alert("=IF(AND(SIGN(A5-A4)%3E=0,SIGN(A4-A3)%3C0),A4,"")")> :alert("=IF(AND(SIGN(A5-A4)%3C0,SIGN(A4-A3)%3E=0),A4,"")")> IF(AND(SIGN(A5-A4)>=0,SIGN(A4-A3)<0),A4,"")IF(AND(SIGN(A5-A4)<0,SIGN(A4-A3)>=0),A4,"")
5-1:alert("=IF(AND(SIGN(A6-A5)%3E=0,SIGN(A5-A4)%3C0),A5,"")")>-1:alert("=IF(AND(SIGN(A6-A5)%3C0,SIGN(A5-A4)%3E=0),A5,"")")> etcetc
64:alert("=IF(AND(SIGN(A7-A6)%3E=0,SIGN(A6-A5)%3C0),A6,"")")> :alert("=IF(AND(SIGN(A7-A6)%3C0,SIGN(A6-A5)%3E=0),A6,"")")> etcetc
76:alert("=IF(AND(SIGN(A8-A7)%3E=0,SIGN(A7-A6)%3C0),A7,"")")> :alert("=IF(AND(SIGN(A8-A7)%3C0,SIGN(A7-A6)%3E=0),A7,"")")>6etcetc
84:alert("=IF(AND(SIGN(A9-A8)%3E=0,SIGN(A8-A7)%3C0),A8,"")")>4:alert("=IF(AND(SIGN(A9-A8)%3C0,SIGN(A8-A7)%3E=0),A8,"")")> etcetc
99:alert("=IF(AND(SIGN(A10-A9)%3E=0,SIGN(A9-A8)%3C0),A9,"")")> :alert("=IF(AND(SIGN(A10-A9)%3C0,SIGN(A9-A8)%3E=0),A9,"")")> etcetc
1016:alert("=IF(AND(SIGN(A11-A10)%3E=0,SIGN(A10-A9)%3C0),A10,"")")> :alert("=IF(AND(SIGN(A11-A10)%3C0,SIGN(A10-A9)%3E=0),A10,"")")>16etcetc
1113:alert("=IF(AND(SIGN(A12-A11)%3E=0,SIGN(A11-A10)%3C0),A11,"")")> :alert("=IF(AND(SIGN(A12-A11)%3C0,SIGN(A11-A10)%3E=0),A11,"")")> etcetc
127:alert("=IF(AND(SIGN(A13-A12)%3E=0,SIGN(A12-A11)%3C0),A12,"")")> :alert("=IF(AND(SIGN(A13-A12)%3C0,SIGN(A12-A11)%3E=0),A12,"")")> etcetc
134:alert("=IF(AND(SIGN(A14-A13)%3E=0,SIGN(A13-A12)%3C0),A13,"")")> :alert("=IF(AND(SIGN(A14-A13)%3C0,SIGN(A13-A12)%3E=0),A13,"")")> etcetc
143:alert("=IF(AND(SIGN(A15-A14)%3E=0,SIGN(A14-A13)%3C0),A14,"")")>3:alert("=IF(AND(SIGN(A15-A14)%3C0,SIGN(A14-A13)%3E=0),A14,"")")> etcetc
155:alert("=IF(AND(SIGN(A16-A15)%3E=0,SIGN(A15-A14)%3C0),A15,"")")> :alert("=IF(AND(SIGN(A16-A15)%3C0,SIGN(A15-A14)%3E=0),A15,"")")> etcetc
165:alert("=IF(AND(SIGN(A17-A16)%3E=0,SIGN(A16-A15)%3C0),A16,"")")> :alert("=IF(AND(SIGN(A17-A16)%3C0,SIGN(A16-A15)%3E=0),A16,"")")> etcetc
178:alert("=IF(AND(SIGN(A18-A17)%3E=0,SIGN(A17-A16)%3C0),A17,"")")> :alert("=IF(AND(SIGN(A18-A17)%3C0,SIGN(A17-A16)%3E=0),A17,"")")>8etcetc
18
19AVG:alert("=AVERAGE(B2:B17)")>2:alert("=AVERAGE(C2:C17)")>10
20 MINMAX
Sheet1

To see the formula in the cells just click on the cells hyperlink

The above image was automatically generated by [HtmlMaker V1.23]
If you want this code, click here and Colo will email the file to you.
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo

Eli


[ This Message was edited by: eliW on 2002-05-21 14:58 ]
eliW is offline   Reply With Quote
Old May 21st, 2002, 03:34 PM   #3
eliW
Board Regular
 
eliW's Avatar
 
Join Date: Mar 2002
Posts: 1,805
Default

Hi all Colo's AddIns users!
Why my formulas are not appearing in the cells in my sample?
How can I fix it?
Eli
eliW is offline   Reply With Quote
Old May 21st, 2002, 08:38 PM   #4
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

What? You mean like your "IF(AND(SIGN..." type formula?

If you hover the mouse pointer over the value that is the result of the formula, you should see the full formula in the status bar at the bottom of your browser. (I'm usinf IE though, so I don't know about any other browser)
__________________
Mark O'Brien

Columbus Ohio Celtic Supporters Club
Mark O'Brien is offline   Reply With Quote
Old May 22nd, 2002, 06:29 AM   #5
sci'01
New Member
 
Join Date: May 2002
Posts: 2
Default

Eli,

Thanks for the solution!

I works nicely however it doesn’t work for what I need it for. I realized this is because my explanation was perhaps not specific enough.

The problem arises when a single wave has a double peak. The data I am using has a few hundred data points per wave and is noisy. I was thinking of doing some sort threshold value to distinguish waves. For example if the wave oscillates +/- 10, the limit values could be +5 for max and –5 for min. The wave would have to pass through the threshold values to count as a max or min. If the wave started at 0 peaked at 9 reduced to 7 and then peak again at 9.5 the max value would be 9.5 If the wave then reduced to a value of –3 but when back up above +5 no min value would be recorded. Hope this explains my problem better

If you any thoughts on how to do they would be much appreciated.

Cheers
sci'01 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:39 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