+ Reply to Thread
Results 1 to 4 of 4

Generate a line (X/Y) graph from a single formula instead of a data set

  1. #1
    Registered User
    Join Date
    07-16-2013
    Location
    Caxias, Portugal
    MS-Off Ver
    Excel 2003
    Posts
    6

    Generate a line (X/Y) graph from a single formula instead of a data set

    I wondered if it is possible to generate a graph from a single formula, and how to set the range of the variable.

    I have this formula: =IF(AM269<=1140;IF(AM269<=250;50;IF(AM269<=600;50+(AM269-250)*0.2;50+(600-250)*0.2+(AM269-600)*0.5));AM269-750)

    The variable "AM269" should vary from 1 to 1100.

    Of course, I can set a corresponding long data table, and then generate a graph from it, but could I generate a graph line (X/Y) by using only formulas?

    Many thanks!

  2. #2
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Generate a line (X/Y) graph from a single formula instead of a data set

    The result of your formula can be only one value so how can you generate a line?
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  3. #3
    Registered User
    Join Date
    07-16-2013
    Location
    Caxias, Portugal
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Generate a line (X/Y) graph from a single formula instead of a data set

    Of course. You are right. To generate a line I should add (I do not know how) some sort of a condition where the variable "AM269" may vary (example: from 1 to 1000)
    Thanks for your question

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Generate a line (X/Y) graph from a single formula instead of a data set

    My thoughts:

    1) The easiest way might be to get a different graphing program. I know many other, more robust graphing packages have an option for "plot this equation" preprogrammed in, making it very easy to graph equations.

    2) However, having posted this in an Excel forum, I'm assuming you want to do this in Excel. IMO, the easiest way to plot anything in Excel (even equations) is to build a table of data points in columns in the spreadsheet. With the correct combination of relative and absolute references, it should take almost no time to build spreadsheet formulas for x and y, copy those down the desired number of rows, then plot those data. In your case, this might look like:
    Please Login or Register  to view this content.
    3) If, for some reason, you feel you cannot have the data calculated in the spreadsheet, then you will have to find/program a VBA routine that will build the x and y arrays, then have your code add those arrays to the chart.

    IMO, option 2 is so much easier than option 3, that I do not know why anyone would bother with 3. If you feel you must try something in VBA, run your query through this and other Excel site's search engines, because I know I have seen these kind of VBA solutions proposed.
    Last edited by MrShorty; 09-06-2013 at 09:09 AM.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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: 0
    Last Post: 03-26-2013, 08:38 PM
  2. Colouring of single line graph
    By taniakoshi in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-03-2012, 08:12 AM
  3. Replies: 3
    Last Post: 06-10-2012, 11:02 AM
  4. Data Plots Generate Plot Graph with Solid / Dash Line
    By batmanfan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2010, 12:13 AM
  5. Macro to generate a line graph with coloured pointers and lables based on table
    By B2009 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 10-08-2009, 07:58 AM

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