Do nothing in excel formula

G

Guest

I am trying to write a formula that will leave the current value in a cell if
the condition is not true. Ex:

=if(c3=april, d5+d6+d7,?)

The question mark represents "doing nothing". No 0, blank or anything. I
just want to leave the data that is in the cell alone if the condition is not
met. Any help would be greatly appreciated.
 
V

vandenberg p

Hello:

I'm not sure I understand. The formula you have has to be in a cell,
so that cell will contain a formula.
assume c3 = april
d5, d6 and d7 all contain a 1

Suppose you enter the formula in D3: (note you need quote marks around "april"

=IF(C3="april",D5+D6+D7:D7,"")

The cell (D3) will contain that formula (look in the formula bar). All you
are doing is controlling what the cell displays on the worksheet and the
above will show 3 or essentially a blank if C3 does not contain the
word "april." But the cell itself (D3) cannot be blank
since it has a formula in it.

Note you cannot use a formula in one cell to modify the
value of another cell.

Pieter Vandenberg

: I am trying to write a formula that will leave the current value in a cell if
: the condition is not true. Ex:

: =if(c3=april, d5+d6+d7,?)

: The question mark represents "doing nothing". No 0, blank or anything. I
: just want to leave the data that is in the cell alone if the condition is not
: met. Any help would be greatly appreciated.
 
V

vandenberg p

Oops. The D7:D7 should read just D7, Although it does no harm.

Pieter Vandenberg

: Hello:

: I'm not sure I understand. The formula you have has to be in a cell,
: so that cell will contain a formula.
: assume c3 = april
: d5, d6 and d7 all contain a 1

: Suppose you enter the formula in D3: (note you need quote marks around "april"

: =IF(C3="april",D5+D6+D7:D7,"")

: The cell (D3) will contain that formula (look in the formula bar). All you
: are doing is controlling what the cell displays on the worksheet and the
: above will show 3 or essentially a blank if C3 does not contain the
: word "april." But the cell itself (D3) cannot be blank
: since it has a formula in it.

: Note you cannot use a formula in one cell to modify the
: value of another cell.

: Pieter Vandenberg

: : I am trying to write a formula that will leave the current value in a cell if
: : the condition is not true. Ex:

: : =if(c3=april, d5+d6+d7,?)

: : The question mark represents "doing nothing". No 0, blank or anything. I
: : just want to leave the data that is in the cell alone if the condition is not
: : met. Any help would be greatly appreciated.
 
N

Niek Otten

Not possible with formulas.
If you describe what you're trying to achieve, someone here might suggest an alternative approach.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

|I am trying to write a formula that will leave the current value in a cell if
| the condition is not true. Ex:
|
| =if(c3=april, d5+d6+d7,?)
|
| The question mark represents "doing nothing". No 0, blank or anything. I
| just want to leave the data that is in the cell alone if the condition is not
| met. Any help would be greatly appreciated.
 
M

matteo garibotti

I succed in doing what the other user was asking for;

a formula like this:

if(a>b;c+d;do nothing)

i've made it without using macros
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top