A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I do an if/then formula



 
 
Thread Tools Display Modes
  #1  
Old September 15th, 2009, 06:41 PM posted to microsoft.public.excel.newusers
mrsjcd3
external usenet poster
 
Posts: 2
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  
Old September 15th, 2009, 07:00 PM posted to microsoft.public.excel.newusers
eduardo
external usenet poster
 
Posts: 2,131
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  
Old September 15th, 2009, 07:11 PM posted to microsoft.public.excel.newusers
Gord Dibben
external usenet poster
 
Posts: 20,252
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 blankg

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  
Old September 15th, 2009, 07:45 PM posted to microsoft.public.excel.newusers
mrsjcd3
external usenet poster
 
Posts: 2
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 blankg

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!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.