Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
using IF function to copy, but leave populated cell alone
I am using the IF function to look for a particular word and copy it to
another cell. H2: =IF(A2="Example Text",A2, "") The problem is that if the word "Example Text" is not found it deletes anything in the target cell or puts FALSE into the target cell (if I take out the ""). How can I preserve the text in the target cell if "Example Text" is not there? any help would be greatly appreciated!! |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
using IF function to copy, but leave populated cell alone
you are asking
if A2 = Example Text then Example Text if not then Blank is this what you want?? maybe =if(A2="Example Text","",A2) |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
using IF function to copy, but leave populated cell alone
Not exactly (thanks for the try)... that puts a blank where some test
was that I want to keep. It would be more like =IF(A1="yes","yes", DO NOTHING) where do nothing means leave that cell alone! Befo A B 1 example text (blank) 2 BlahBla goodstuff 3 example text (blank) After: A B 1 example text example text 2 BlahBla goodstuff 3 example text example text |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
using IF function to copy, but leave populated cell alone
Whatever other data you want in the cell if the criteria is not met should be
your third parameter. Or, your third parameter could be another if statement to test for some other data, and if that is not found, return a "". Unless they are nested or concatenated, two functions or pieces of data cannot occupy the same cell. IF(A1="yes",A1,other data) IF (A1="yes",A1,IF(test for other data, other data, "")) " wrote: Not exactly (thanks for the try)... that puts a blank where some test was that I want to keep. It would be more like =IF(A1="yes","yes", DO NOTHING) where do nothing means leave that cell alone! Befo A B 1 example text (blank) 2 BlahBla goodstuff 3 example text (blank) After: A B 1 example text example text 2 BlahBla goodstuff 3 example text example text |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
using IF function to copy, but leave populated cell alone
One other thing, you could enter the first IF statement I suggested in a
third column, then copy this third column, click Edit/Paste Special/Values over your original data in column B. Just be sure to back up before trying anything new. " wrote: Not exactly (thanks for the try)... that puts a blank where some test was that I want to keep. It would be more like =IF(A1="yes","yes", DO NOTHING) where do nothing means leave that cell alone! Befo A B 1 example text (blank) 2 BlahBla goodstuff 3 example text (blank) After: A B 1 example text example text 2 BlahBla goodstuff 3 example text example text |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
using IF function to copy, but leave populated cell alone
Here is what I ended up using in VBA
Dim TheCell As Range For C = 1 To 100 Set TheCell = Cells(C, 2) If IsEmpty(TheCell.Value) Then TheCell.Value = TheCell.Offset(0, -1).Value End If Next C End Sub use a second loop if you want to continue to add the text to addition cells JMB wrote: One other thing, you could enter the first IF statement I suggested in a third column, then copy this third column, click Edit/Paste Special/Values over your original data in column B. Just be sure to back up before trying anything new. " wrote: Not exactly (thanks for the try)... that puts a blank where some test was that I want to keep. It would be more like =IF(A1="yes","yes", DO NOTHING) where do nothing means leave that cell alone! Befo A B 1 example text (blank) 2 BlahBla goodstuff 3 example text (blank) After: A B 1 example text example text 2 BlahBla goodstuff 3 example text example text |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
disabling the copy paste function in a cell | Excel Worksheet Functions | |||
how to count the number of text frequencies and copy to other cell | Excel Worksheet Functions | |||
What worksheet function will formatlessly copy cell contents? | Excel Worksheet Functions | |||
Function syntax to compare cell contents | Excel Worksheet Functions | |||
copy a cell value not its function | Excel Discussion (Misc queries) |