Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default adding text to column cell if there's a value present

I have a column of about 3000 cells...some of them are empty and some have a
number in them from 1 to 4 digits (21 , 454, 1001, 2) etc. These are
address/unit numbers. I'm trying to write a function that will check each
cell and if there's a value in it...write Unit 'value' so I get Unit 454
, etc. If the cell is empty...then there's no "Unit" text added ?

Been trying for awhile but don't seem to be getting close...any ideas on
this type of function ?

Thanks, Tim


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default adding text to column cell if there's a value present

You can use this IF function to produce the result you need:

=IF(ISNUMBER(A1),"Unit "&A1,"")

Change the Column as needed and copy it down to the last row.

You can also use if the column having unit numbers has something like 12B:

=IF(ISBLANK(A1),"","Unit "&A1)
--
Kevin Backmann


"Tim R" wrote:

I have a column of about 3000 cells...some of them are empty and some have a
number in them from 1 to 4 digits (21 , 454, 1001, 2) etc. These are
address/unit numbers. I'm trying to write a function that will check each
cell and if there's a value in it...write Unit 'value' so I get Unit 454
, etc. If the cell is empty...then there's no "Unit" text added ?

Been trying for awhile but don't seem to be getting close...any ideas on
this type of function ?

Thanks, Tim



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default adding text to column cell if there's a value present

=IF(A1="","","Unit "&A1)
--
David Biddulph

"Tim R" wrote in message
...
I have a column of about 3000 cells...some of them are empty and some have
a number in them from 1 to 4 digits (21 , 454, 1001, 2) etc. These are
address/unit numbers. I'm trying to write a function that will check each
cell and if there's a value in it...write Unit 'value' so I get Unit
454 , etc. If the cell is empty...then there's no "Unit" text added ?

Been trying for awhile but don't seem to be getting close...any ideas on
this type of function ?

Thanks, Tim



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default adding text to column cell if there's a value present

On Oct 23, 2:15 pm, "Tim R" wrote:
I have a column of about 3000 cells...some of them are empty and some have a
number in them from 1 to 4 digits (21 , 454, 1001, 2) etc. These are
address/unit numbers. I'm trying to write a function that will check each
cell and if there's a value in it...write Unit 'value' so I get Unit 454
, etc. If the cell is empty...then there's no "Unit" text added ?

Been trying for awhile but don't seem to be getting close...any ideas on
this type of function ?

Thanks, Tim


The following will work...assuming that your units are in column A and
that the actual unit numbers begin in row 2.

Jennifer

Sub Modify_Text()
Dim X As Integer
Dim sValue As String

For X = 2 To 3000
If Sheet1.Cells(X, 1).Value < "" Then
sValue = Sheet1.Cells(X, 1).Value
Sheet1.Cells(X, 1).Value = "Unit " & Sheet1.Cells(X,
1).Value
End If
Next X
End Sub

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
adding up number of people present at certain times bamboozled Excel Worksheet Functions 4 September 18th 07 09:02 AM
Need to parse column data only when text is present Phil Excel Worksheet Functions 0 July 10th 07 08:22 PM
Forgotten a Simple Forumla - Is Text present in another column samprince Excel Discussion (Misc queries) 3 August 4th 06 04:22 PM
adding text to a column of exsisting data Dalerj70 Excel Discussion (Misc queries) 3 May 24th 05 04:58 PM
SUM/COUNT column(s) based on specific value present within the column markx Excel Worksheet Functions 6 March 22nd 05 10:23 AM


All times are GMT +1. The time now is 11:19 PM.

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

About Us

"It's about Microsoft Excel"