+ Reply to Thread
Results 1 to 6 of 6

Line Graph Of Profit Against Time

  1. #1
    Registered User
    Join Date
    08-29-2015
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    13

    Line Graph Of Profit Against Time

    Hi All,

    I have written a fairly simple excel (2013) program that calculates and displays some poker stats.

    This includes displaying your total profit in a single cell.

    This value changes as you input your different sessions profits/loss'.

    Is there a way to graph this profit value against the date? I.e. i need a graph that updates every time i update my profit and charts it against the current date.

    Thanks,

    Cam

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: Line Graph Of Profit Against Time

    Not really that way you described it. The data for each date shal be stored somewhere in the workbook and then can of course be plotted. If it is just one cell which changes daily or time to time , you can only plot it's curent value (not very informative graph :-P)

    As for automatic storing date and value - it can be done with simple macro for Worksheet_Change event.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    08-29-2015
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    13

    Re: Line Graph Of Profit Against Time

    Thanks for your reply,

    Could you tell me how i would set up such a macro?

    Cam

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: Line Graph Of Profit Against Time

    Worksheet_Change is keyword to our search engine http://www.excelforum.com/search.php :-)

    The code could be as simple as that:
    Please Login or Register  to view this content.
    There are 2 sheets Archive one and the one with data. lets say value is in C3 of data and in archive in columns A and B is excel table (Ctrl+T) with dates and values.
    As these are in Table, the graph is updated every time new value appears in table. and it appears when above code is executed.
    This code is in your sheet data code (right click on tab and choose "display code")
    Try this

    PS. if changes are more frequent (more often than daily) I'd personally change graph type to scatterplot.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-29-2015
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    13

    Re: Line Graph Of Profit Against Time

    Excellent, thank you

    Now, what if i dont want to use a 2nd archive sheet and have the data and the table on the same sheet?

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: Line Graph Of Profit Against Time

    No problem
    Use the samme sheet, just different columns :-)

+ 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. Replies: 2
    Last Post: 08-29-2011, 12:29 PM
  2. convert excel data into a time line bar graph
    By excelforum2009 in forum Excel General
    Replies: 1
    Last Post: 06-25-2009, 06:34 AM
  3. w/ Line graph with time on X and missing data
    By matlack in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-17-2007, 11:49 AM
  4. VB for plotting time line on xy graph...
    By Chris_john Turner in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2006, 07:00 AM
  5. VB for plotting time line on xy graph...
    By sacrum in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2006, 06:51 AM
  6. Line graph for cumulative number over time
    By Jane in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-09-2006, 02:20 AM
  7. Time line in excel graph
    By Wilkesy50 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 04-27-2005, 04:06 PM
  8. [SOLVED] Time axis column and scatter/line graph
    By kraymond in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 02-08-2005, 08:06 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