Can I Use an IF Statement for Regression in Excel?

In summary, to use the IF statement in Excel, select the cell where you want the result, type "=IF(" followed by the condition, specify what to do if the condition is met and not met, and press enter. The syntax for the IF statement is "=IF(logical_test, value_if_true, value_if_false)". Multiple IF statements can be nested using the syntax "=IF(logical_test, value_if_true, IF(logical_test, value_if_true, value_if_false))". The "AND" and "OR" functions can be used to evaluate multiple conditions within an IF statement. The IF statement can also be used to format cells in Excel using the conditional formatting feature.
  • #1
MaxManus
277
1
Regression in Excel

I want to make an regression of some data, but I only want to use some of the data. The data I want use is where Vacant = 1.
Is this possible in excel?

I have tried to use the if-function but the regression does not like "false"


More info

I want to make a regression of Price = B1 + B2*sqft for the vacant houses.
 

Attachments

  • stockton2.xls
    76 KB · Views: 252
Last edited:
Physics news on Phys.org
  • #2
Excel is mostly hands-on

The simple solution is sort on the vacancy column and then graph the data with vacancy=1 using scatter plot.
This would be the result: price = 69.9 SQFT - 4793
 

Attachments

  • stockton2(1).xls
    93 KB · Views: 279
  • #3
Thanks.
 

1. How do I use the IF statement in Excel?

To use the IF statement in Excel, you must first select the cell where you want the result to be displayed. Then, type "=IF(" into the formula bar followed by the condition or statement you want to evaluate. Next, enter a comma and specify what you want to happen if the condition is met, followed by another comma. Finally, specify what you want to happen if the condition is not met and close the parentheses. Press enter to complete the formula.

2. What is the syntax for the IF statement in Excel?

The syntax for the IF statement in Excel is "=IF(logical_test, value_if_true, value_if_false)". The "logical_test" is the condition or statement that is being evaluated. The "value_if_true" is what will happen if the condition is met, and the "value_if_false" is what will happen if the condition is not met.

3. Can I use multiple IF statements in one cell in Excel?

Yes, you can use multiple IF statements in one cell in Excel. This is known as a nested IF statement. To do this, you would use the syntax "=IF(logical_test, value_if_true, IF(logical_test, value_if_true, value_if_false))". You can continue nesting IF statements as needed.

4. How do I use the "AND" or "OR" functions in an IF statement in Excel?

You can use the "AND" or "OR" functions within an IF statement in Excel to evaluate multiple conditions. To use the "AND" function, you would enter "=IF(AND(logical_test1, logical_test2), value_if_true, value_if_false)". To use the "OR" function, you would enter "=IF(OR(logical_test1, logical_test2), value_if_true, value_if_false)".

5. Can I use the IF statement to format cells in Excel?

Yes, you can use the IF statement to format cells in Excel. To do this, you would use the conditional formatting feature. Select the cells you want to format, then go to the "Home" tab and click on "Conditional Formatting". From there, select "New Rule" and choose the option "Use a formula to determine which cells to format". Enter your IF statement as the formula, and then select the formatting you want to apply if the condition is met.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
13
Views
2K
  • STEM Educators and Teaching
Replies
11
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
857
  • Set Theory, Logic, Probability, Statistics
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
2
Replies
64
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
17
Views
3K
  • Introductory Physics Homework Help
Replies
10
Views
1K
Back
Top