Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 7
Default How do I do an if/then formula

I know this should be simple but I need help,

I need a blank cell to have "X" and a non-blank cell to have "Have"

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,276
Default How do I do an if/then formula

Hi,
I don't quite understand your question, if you mean when A1 is blank to
enter an X in cell B1 or "Have" if A1 is not blank use

=if(A1="","X","HAVE")


"mrsjcd3" wrote:

I know this should be simple but I need help,

I need a blank cell to have "X" and a non-blank cell to have "Have"

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 22,906
Default How do I do an if/then formula

Why should it be simple?

A blank cell cannot have an "X" or it would not be blank<g

A cell cannot have a formula and a value.

Do you want to use formulas in helper cells to achieve this?

In B1 =IF(A1="","X","Have")

Do you want to use VBA code to achieve this without formulas?

Sub test()
For Each cell In Selection
If cell.Value = "" Then
cell.Value = "X"
Else
cell.Value = "Have"
End If
Next
End Sub


Gord Dibben MS Excel MVP


On Tue, 15 Sep 2009 10:41:01 -0700, mrsjcd3
wrote:

I know this should be simple but I need help,

I need a blank cell to have "X" and a non-blank cell to have "Have"

Thanks!


  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 7
Default How do I do an if/then formula

I understand now. I will probably use the VBA in this instance.
Thanks!

"Gord Dibben" wrote:

Why should it be simple?

A blank cell cannot have an "X" or it would not be blank<g

A cell cannot have a formula and a value.

Do you want to use formulas in helper cells to achieve this?

In B1 =IF(A1="","X","Have")

Do you want to use VBA code to achieve this without formulas?

Sub test()
For Each cell In Selection
If cell.Value = "" Then
cell.Value = "X"
Else
cell.Value = "Have"
End If
Next
End Sub


Gord Dibben MS Excel MVP


On Tue, 15 Sep 2009 10:41:01 -0700, mrsjcd3
wrote:

I know this should be simple but I need help,

I need a blank cell to have "X" and a non-blank cell to have "Have"

Thanks!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"