# chart function of two variables

#### hemsleysut

##### Board Regular
I'll like to graph a function of two variables eg. f(x,y)=2x^2-y^2-y. I suspect I will need the surface chart but can some one tell me how to generate the chart and what to enter on the worksheet. Thanking you in advance.

### Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

#### ThePencilQueen

##### Board Regular
ok this is a little bit complicated but doable (well I just did it for your example and it looks very pretty).

First you need to list some regularly spaced (ie 1,2,3 or 5,10,15 or 100,200,300) x values along row 1 (starting in cell b1).
Then list some y values (again regularly spaced...preferably the same values as you used for x) down column A (starting in cell A2).
=(2*(B\$1^2))-(\$A2^2)-\$A2
The dollar signs mean that the formula will always use the value in row 1 or column a.
Autofill the formula (hover the mouse over the bottom right hand corner of B2 until you see a + sign, click and drag) along the whole of row 2, untill you get to the end of your x values, then autofill down until you reach the end of your y values.

Once this is done simply select the cells containing the formula and do a surface chart.

The surface chart uses the cell position to determine the data points x,y co-ordinates and the value in the cell is plotted along the z axis.

I hope this makes some sense.

Replies
2
Views
113
Replies
1
Views
71
Replies
1
Views
269
Replies
0
Views
56
Replies
1
Views
213

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,545
Messages
5,832,380
Members
430,128
Latest member
ojl987

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back