+ Reply to Thread
Results 1 to 6 of 6

Selecting data and using it for further calculation

  1. #1
    Registered User
    Join Date
    07-11-2014
    Location
    Austria
    MS-Off Ver
    Windows 8
    Posts
    7

    Selecting data and using it for further calculation

    Hey!

    I hope you can help me with the following problem. I have got historical intraday-data of a stock index and first of all need to summarize them by seconds:
    The data looks like that:
    time price
    08.00.00 159
    08.00.00 153
    08.00.00 148
    08.00.01 157
    08.00.01 152
    08.00.02 167
    08.00.02 151
    08.00.03 155
    08.00.03 154
    08.00.03 154

    So I want to calculate the average price per second. Is there any formula to tell Excel that it should sort it by second and further calculate the average price of it. If I need to sort it by hand it would take me ages due to the huge size of the data. I hope anyone can help me=)

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Selecting data and using it for further calculation

    Hi and welcome to the foum

    If I need to sort it by hand it would take me ages
    excel has a built-in sorting function. You did not provide a version that you are using, so on the DATA tab, click on the SORT button
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Selecting data and using it for further calculation

    Hi, and welcome to the forum.

    There's no need to sort your data.

    See attached
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Selecting data and using it for further calculation

    Are you familiar with pivot tables?

    You can select the entire range, then put TIME in the ROW LABELS and Price in the Values then right click in the pivot to change SUM to Average and you have an itemized avg AND a total avg at the bottom. It took me about 5 seconds to do.

    Stock PivotTables.xlsx
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Selecting data and using it for further calculation

    I would use some helper columns to do this.

    I will knock up something for you.

    Ok this first sheet shows you the formulae to use.

    Just read Mikes Solution.

    I'll stop here if that meets your requirement.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-11-2014
    Location
    Austria
    MS-Off Ver
    Windows 8
    Posts
    7

    Re: Selecting data and using it for further calculation

    Hey all togehter=)

    Thanks so much for all your quick and very helpful responses. You saved me a lot of time!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Selecting all data in specific columns without selecting adjacent column.
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2014, 02:20 AM
  2. Selecting all data in specific columns without selecting adjacent column.
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2014, 03:50 PM
  3. Replies: 2
    Last Post: 08-01-2013, 07:36 AM
  4. Selecting Cells For Calculation
    By Bsir in forum Excel General
    Replies: 8
    Last Post: 07-15-2011, 03:41 PM
  5. Selecting a Range and performing a calculation
    By confusedvba in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2010, 06:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1