Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 54
Default IF function - If false argument query

I would like to fill cells with X, if they don't already have a letter in
them. I started to use the IF function, but am confused by how I should
treat the 'if false' argument. Some cells already have a C, or an R, and I
don't want to override the existing text.
=IF(" ","x",)
Should I be using a different function? Pity conditional formatting can't
return text
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default IF function - If false argument query

On the face of it, you could try in B1, copied down:
=IF(TRIM(A1)="","X",TRIM(A1))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Twishlist" wrote:
I would like to fill cells with X, if they don't already have a letter in
them. I started to use the IF function, but am confused by how I should
treat the 'if false' argument. Some cells already have a C, or an R, and I
don't want to override the existing text.
=IF(" ","x",)
Should I be using a different function? Pity conditional formatting can't
return text

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default IF function - If false argument query

Not sure that I have interpreted your question correctly. =IF(" ","x",) Does
this mean if there is a space in the cell or is nothing in the cell?

Anyway, Dave Petersen had an answer a few days ago for a different reason
but referring to using the replace command whereby you can actually replace
nothing with something by simply leaving the Find what blank. However, if it
is a space then you can also replace that with something by typing a space in
the Find what field but ensure that you set the option to Match entire cell
contents.

Make sure that you back up your workbook before you attempt the above.

When testing the method I found that it would only work with the actual used
area of a worksheet. If you select a blank range on a new worksheet then the
find nothing failed. If you insert a character in the last cell of the area
to be selected then it worked. (Only tested with xl2007.)

--
Regards,

OssieMac


"Twishlist" wrote:

I would like to fill cells with X, if they don't already have a letter in
them. I started to use the IF function, but am confused by how I should
treat the 'if false' argument. Some cells already have a C, or an R, and I
don't want to override the existing text.
=IF(" ","x",)
Should I be using a different function? Pity conditional formatting can't
return text

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default IF function - If false argument query

No prob. Happy to hear you got what you wanted.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Twishlist" wrote in message
...
Thanks for your response Max, but when I tried it, I got a FALSE result.
I
tried the find/replace option as suggested by OssieMac and it worked
beautifully for this purpose.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 54
Default IF function - If false argument query

Thanks for your response Mac, but when I tried it, I got a FALSE result. I
tried the find/replace option as suggested by OssieMac and it worked
beautifully for this purpose.

"Max" wrote:

On the face of it, you could try in B1, copied down:
=IF(TRIM(A1)="","X",TRIM(A1))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Twishlist" wrote:
I would like to fill cells with X, if they don't already have a letter in
them. I started to use the IF function, but am confused by how I should
treat the 'if false' argument. Some cells already have a C, or an R, and I
don't want to override the existing text.
=IF(" ","x",)
Should I be using a different function? Pity conditional formatting can't
return text



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 54
Default IF function - If false argument query

No I didn't have a space in the cell, just empty of content. Tried the
find/replace option and it worked perfectly for this purpose...don't know why
I didn't think of it. Thank goodness for this Discussion Group for dulled
minds like mine. Thanks heaps.

"OssieMac" wrote:

Not sure that I have interpreted your question correctly. =IF(" ","x",) Does
this mean if there is a space in the cell or is nothing in the cell?

Anyway, Dave Petersen had an answer a few days ago for a different reason
but referring to using the replace command whereby you can actually replace
nothing with something by simply leaving the Find what blank. However, if it
is a space then you can also replace that with something by typing a space in
the Find what field but ensure that you set the option to Match entire cell
contents.

Make sure that you back up your workbook before you attempt the above.

When testing the method I found that it would only work with the actual used
area of a worksheet. If you select a blank range on a new worksheet then the
find nothing failed. If you insert a character in the last cell of the area
to be selected then it worked. (Only tested with xl2007.)

--
Regards,

OssieMac


"Twishlist" wrote:

I would like to fill cells with X, if they don't already have a letter in
them. I started to use the IF function, but am confused by how I should
treat the 'if false' argument. Some cells already have a C, or an R, and I
don't want to override the existing text.
=IF(" ","x",)
Should I be using a different function? Pity conditional formatting can't
return text

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function argument not returning a value Linda Excel Worksheet Functions 11 December 28th 07 11:38 PM
How can I get around 30 argument limit of SUM function? Randy Excel Worksheet Functions 4 May 9th 07 09:05 PM
FALSE argument in VLOOKUP Dave F Excel Worksheet Functions 2 August 30th 06 10:27 PM
VBA function for "Mean" using Array as argument ASokolik Excel Worksheet Functions 21 March 28th 06 10:05 PM
Need Function Argument pasekm Excel Worksheet Functions 4 March 18th 06 11:14 PM


All times are GMT +1. The time now is 03:08 PM.

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"