ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   IF statements (https://www.excelbanter.com/excel-programming/312656-if-statements.html)

Dr_Ray[_2_]

IF statements
 
I have a HUGE spreadsheet and want to blank out certain cells based upon a
test to see if other cells are also blank. For example:

A B C
1 .5 3
2 .1 0
3 0
4 .3 1

It is easy enough to place an IF statement in column C to test to see if the
cells in column A are blank, which A3 is in this example. But what I want to
do is to use an IF statement (or something else) to write a blank over the
corresponding cell in column B if the cell in column A is also blank. Any
ideas?

Frank Kabel

IF statements
 
Hi
why not use a filter for this ('Data - Filter')

--
Regards
Frank Kabel
Frankfurt, Germany

"Dr_Ray" schrieb im Newsbeitrag
...
I have a HUGE spreadsheet and want to blank out certain cells based

upon a
test to see if other cells are also blank. For example:

A B C
1 .5 3
2 .1 0
3 0
4 .3 1

It is easy enough to place an IF statement in column C to test to see

if the
cells in column A are blank, which A3 is in this example. But what I

want to
do is to use an IF statement (or something else) to write a blank

over the
corresponding cell in column B if the cell in column A is also blank.

Any
ideas?



CB Hamlyn

IF statements
 
One way I would do it (if you're looking to do it without using VBA) is like
this:

for each cell in column C (changing the row number as appropriate):
------------------------
=IF(A1="","",A1)
------------------------
This way if Column A is empty it will leave C blank.

for each cell in column D (changing the row number as appropriate):
--------------------------------
=IF(C1="","",IF(B1="","",B1))
--------------------------------
This way if column C (the new column A) is empty
it leaves column D (the new column B) empty.
if C is not empty but B is, it will leave D empty as well.

Then you simply use the info from columns C and D instead of using columns A
and B.


"Dr_Ray" wrote in message
...
I have a HUGE spreadsheet and want to blank out certain cells based upon a
test to see if other cells are also blank. For example:

A B C
1 .5 3
2 .1 0
3 0
4 .3 1

It is easy enough to place an IF statement in column C to test to see if
the
cells in column A are blank, which A3 is in this example. But what I want
to
do is to use an IF statement (or something else) to write a blank over the
corresponding cell in column B if the cell in column A is also blank. Any
ideas?




Dr_Ray

IF statements
 
Duh. I knew there had to be another way to approach this (without using
VBA...mine is rusty to say the least).

Your approach works. BTW...it looks like one can eliminate the first step
and simply do the test on Column A.

At any rate, thanks for your help.

"CB Hamlyn" wrote:

One way I would do it (if you're looking to do it without using VBA) is like
this:

for each cell in column C (changing the row number as appropriate):
------------------------
=IF(A1="","",A1)
------------------------
This way if Column A is empty it will leave C blank.

for each cell in column D (changing the row number as appropriate):
--------------------------------
=IF(C1="","",IF(B1="","",B1))
--------------------------------
This way if column C (the new column A) is empty
it leaves column D (the new column B) empty.
if C is not empty but B is, it will leave D empty as well.

Then you simply use the info from columns C and D instead of using columns A
and B.


"Dr_Ray" wrote in message
...
I have a HUGE spreadsheet and want to blank out certain cells based upon a
test to see if other cells are also blank. For example:

A B C
1 .5 3
2 .1 0
3 0
4 .3 1

It is easy enough to place an IF statement in column C to test to see if
the
cells in column A are blank, which A3 is in this example. But what I want
to
do is to use an IF statement (or something else) to write a blank over the
corresponding cell in column B if the cell in column A is also blank. Any
ideas?





CB Hamlyn

IF statements
 
Your approach works. BTW...it looks like one can eliminate the first step
and simply do the test on Column A.

I included it on the chance you needed to see both columns (or the output of
them anyway) side by side. If not then yes, by all means skip the first
part.

At any rate, thanks for your help.

You're very welcome.

CB Hamlyn


"CB Hamlyn" wrote:

One way I would do it (if you're looking to do it without using VBA) is
like
this:

for each cell in column C (changing the row number as appropriate):
------------------------
=IF(A1="","",A1)
------------------------
This way if Column A is empty it will leave C blank.

for each cell in column D (changing the row number as appropriate):
--------------------------------
=IF(C1="","",IF(B1="","",B1))
--------------------------------
This way if column C (the new column A) is empty
it leaves column D (the new column B) empty.
if C is not empty but B is, it will leave D empty as well.

Then you simply use the info from columns C and D instead of using
columns A
and B.


"Dr_Ray" wrote in message
...
I have a HUGE spreadsheet and want to blank out certain cells based upon
a
test to see if other cells are also blank. For example:

A B C
1 .5 3
2 .1 0
3 0
4 .3 1

It is easy enough to place an IF statement in column C to test to see
if
the
cells in column A are blank, which A3 is in this example. But what I
want
to
do is to use an IF statement (or something else) to write a blank over
the
corresponding cell in column B if the cell in column A is also blank.
Any
ideas?








All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com