Excel graph/regress...
 

Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop

[Closed] Excel graph/regression problem

6 Posts
4 Users
0 Reactions
89 Views
Posts: 0
Free Member
Topic starter
 

Hello,

I have had a good google around and I can't find the solution to this problem:

I have an X-Y scatter graph with a linear regression line (and equation) through the data - that bit is OK.

The problem lies with the underlying data. Some of the X or Y data have a value of 0 (rather then being a empty cell) and so when plotted this has an effect on the regression equation - "pulling the line towards the zero point on the X axis).

Is there a work around that would ignore the 0 values, change them to something else that excel won't graph or similar, that saves me having to go though and delete all the 0 cells manually.

Any thoughts would be greatly appreciated.

Thanks!


 
Posted : 09/06/2013 12:35 pm
Posts: 25873
Full Member
 

do you mean that the cells for those points "should" be blank but have somehow gained status as a zero value ?

If they're valid data points I'd have thought they should be contributing to the regression


 
Posted : 09/06/2013 12:39 pm
Posts: 0
Free Member
Topic starter
 

Scaredypants, they do have a value of "zero" but I want them to behave as if they are "blank".


 
Posted : 09/06/2013 12:43 pm
Posts: 71
Free Member
 

Go to raw data - find and replace 0 with blank, match entire cell contents.


 
Posted : 09/06/2013 12:44 pm
Posts: 0
Free Member
Topic starter
 

njee20 - are you talking about the "find and replace" function in the toolbar? Is there a formula that would do that?


 
Posted : 09/06/2013 12:46 pm
 poly
Posts: 8747
Free Member
 

you can search and replace (on the Edit menu) although I'm not a fan of replacing data like that - make sure you tick the "entire cells" box. I would be inclined to use

=if(B1=0,#N/A,B1)

which would replace the 0's with n/a which is ignored in the regression


 
Posted : 09/06/2013 1:51 pm
Posts: 0
Free Member
Topic starter
 

poly, that's done it! I was trying to be to clever - that's a nice simple solution. Thanks.


 
Posted : 09/06/2013 8:52 pm