Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Function Max

good morning,

i'm managing a worksheet that is organized as follows:

Columns A: Time
Cell B1: Default Time 9:10:00
Cell C1: Bin Time 00:05:00
Columns D: This formula(let's call time bin)
=CEILING(A2-$B$1;$B$1)/$B$1

I'd like to write a sub in vba that calculate the maximun whithin every
Time Bin.

thank you



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Function Max

dim myMax as double
myMax = application.max(worksheets("sheet1").range("d:d"))

(I'm not sure what "every time bin" means. This finds the maximum within column
D.)



ferrdav wrote:

good morning,

i'm managing a worksheet that is organized as follows:

Columns A: Time
Cell B1: Default Time 9:10:00
Cell C1: Bin Time 00:05:00
Columns D: This formula(let's call time bin)
=CEILING(A2-$B$1;$B$1)/$B$1

I'd like to write a sub in vba that calculate the maximun whithin every
Time Bin.

thank you

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Function Max

thank's dave, but my problem it's a bit more complex:

time bin it's a function that assess a number to those trades that are
in whithin a certain range of time, let's say 5 minutes.

since the number of trades (for a security) aren't the same for 5
minutes in 5 minutes, i need to isolate prices that were made in first
5 minutes of tdaes (time bin = 1) form those in the second five minutes
of trade (time bin=2) and so on... this' what time bin function does

what i need is to calculate the maximum price between those in time bin
1, and then the maximum in time bin 2 and so on...

i believe i should use a do..while loop, but i cannot do that...:(



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Function Max

I'm not sure I understand, but if you have 1,2,3,... in the timebins column
(column B), you could use a formula like:

=MAX(IF(B1:B99=1,A1:A99))

A pivottable might work nicely, too. You can show the
max/min/average/sum/count/(lots of stuff) based on that timebins column.



ferrdav wrote:

thank's dave, but my problem it's a bit more complex:

time bin it's a function that assess a number to those trades that are
in whithin a certain range of time, let's say 5 minutes.

since the number of trades (for a security) aren't the same for 5
minutes in 5 minutes, i need to isolate prices that were made in first
5 minutes of tdaes (time bin = 1) form those in the second five minutes
of trade (time bin=2) and so on... this' what time bin function does

what i need is to calculate the maximum price between those in time bin
1, and then the maximum in time bin 2 and so on...

i believe i should use a do..while loop, but i cannot do that...:(

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


All times are GMT +1. The time now is 02:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"