Solved

Question about If Statment in Excel

Posted on 2014-10-25
4
151 Views
Last Modified: 2014-10-26
Is it possible to have an if statement in excel that will do the following and if so how would you write it?
I have column B and Column M.

I want the if statement to go down column B.
I want the if statement to do if possible to see if column M2 is 0 if it is to do the following in B2.
Copy B1 formula into B2 and if M2 is not 0 to use another formula.

When I say copy B1 formula into B2, I mean do not automatic change the column letters or numbers, others words if it days B1 = G1 + H1 I want it to stay B1 = G1 + H1 not B2 = G2 + H2
Because I want the outcome that was in B1 to be in B2. If this possible I will be taking the formula from B1 to B90

I hope this is clear enough.
0
Comment
Question by:starview
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 22

Accepted Solution

by:
Ejgil Hedegaard earned 300 total points
ID: 40404148
Use $ to lock the cell references when copying.
In B2: =IF(M2=0,$B$1,"another formula")
0
 
LVL 15

Assisted Solution

by:Haris Djulic
Haris Djulic earned 50 total points
ID: 40404265
If i understood correctly, if M(any row) is equal to 0 then copy the value from one row above, then this formula will work:

=IF(M2=0;INDIRECT("B"&ROW()-1);"another formula")

Open in new window


but if you always want to show the value from B1 then the Ejgil formula will do the trick..
0
 

Author Comment

by:starview
ID: 40404381
I am trying to use Ejgil formula
=IF(F15=0,$B$14,"=((16*B14)-((G15-F15)/(3500/16)))/16")
But when I put an amount into F15 it show wrong data. it looks like it is formatting that cell
I have to copy a blank cell back to F15
0
 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 150 total points
ID: 40404462
starview,

You're now referencing a difference column altogether (column F, cell F15) and you're on a different row (15 vs. 2).

You just need to remove the quotes in the [value_if_false] argument:
=IF(F15=0,$B$14,((16*B14)-((G15-F15)/(3500/16)))/16)

Regards,
-Glenn
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My experience with Windows 10 over a one year period and suggestions for smooth operation
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question