Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 61
Default How do I add 1 to a number in column b

I have a spreadsheet in which column b refers to the number of years of safe
driving. ie "22 years". How do I add 1 to each cell in column B?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,722
Default How do I add 1 to a number in column b

If you literally wrote "22 years" into a single cell, the manipulation needed
is:

=LEFT(B2,FIND(" ",B2)-1)+1&" years"
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"diana" wrote:

I have a spreadsheet in which column b refers to the number of years of safe
driving. ie "22 years". How do I add 1 to each cell in column B?

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 61
Default How do I add 1 to a number in column b

I didn't use quotation marks. it's just 22 years

"Luke M" wrote:

If you literally wrote "22 years" into a single cell, the manipulation needed
is:

=LEFT(B2,FIND(" ",B2)-1)+1&" years"
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"diana" wrote:

I have a spreadsheet in which column b refers to the number of years of safe
driving. ie "22 years". How do I add 1 to each cell in column B?

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,124
Default How do I add 1 to a number in column b

A formula approach
=LEFT(J5,FIND(" ",J5)-1)+1& " years"

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"diana" wrote in message
...
I have a spreadsheet in which column b refers to the number of years of
safe
driving. ie "22 years". How do I add 1 to each cell in column B?


  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,722
Default How do I add 1 to a number in column b

Sorry, I should have made that clearer. The real question was to confirm that
you were combining the value (22) with text (years) into the same cell.
(which you are)

The formula I gave you will take the value from the cell, add 1 to it, then
add on the text string. Simply place it into an empy column and copy down as
needed.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"diana" wrote:

I didn't use quotation marks. it's just 22 years

"Luke M" wrote:

If you literally wrote "22 years" into a single cell, the manipulation needed
is:

=LEFT(B2,FIND(" ",B2)-1)+1&" years"
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"diana" wrote:

I have a spreadsheet in which column b refers to the number of years of safe
driving. ie "22 years". How do I add 1 to each cell in column B?



  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 61
Default How do I add 1 to a number in column b

No, I didn't use quotation marks and I need to change column b for each row
in my spreadsheet.

"Luke M" wrote:

If you literally wrote "22 years" into a single cell, the manipulation needed
is:

=LEFT(B2,FIND(" ",B2)-1)+1&" years"
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"diana" wrote:

I have a spreadsheet in which column b refers to the number of years of safe
driving. ie "22 years". How do I add 1 to each cell in column B?

  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,124
Default How do I add 1 to a number in column b

A macro solution
Sub addnumbertotext()
'=LEFT(J5,FIND(" ",J5)-1)+1& " years"
For Each c In Range("b2:b22") 'Selection
c.Value = Left(c, InStr(c, " ") - 1) + 1 & " years"

Next c
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
A formula approach
=LEFT(J5,FIND(" ",J5)-1)+1& " years"

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"diana" wrote in message
...
I have a spreadsheet in which column b refers to the number of years of
safe
driving. ie "22 years". How do I add 1 to each cell in column B?



  #8   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,934
Default How do I add 1 to a number in column b

Assuming the cells in the range contain either whole numbers or, if floating
point numbers are used, the decimal point for the system is a "dot", then
this statement...

c.Value = Left(c, InStr(c, " ") - 1) + 1 & " years"

can be replaced with this slightly simpler one...

c.Value = Val(c.Value) + 1 & " years"

--
Rick (MVP - Excel)


"Don Guillett" wrote in message
...
A macro solution
Sub addnumbertotext()
'=LEFT(J5,FIND(" ",J5)-1)+1& " years"
For Each c In Range("b2:b22") 'Selection
c.Value = Left(c, InStr(c, " ") - 1) + 1 & " years"

Next c
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
A formula approach
=LEFT(J5,FIND(" ",J5)-1)+1& " years"

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"diana" wrote in message
...
I have a spreadsheet in which column b refers to the number of years of
safe
driving. ie "22 years". How do I add 1 to each cell in column B?




  #9   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 35,218
Default How do I add 1 to a number in column b

Instead of putting the string " years" in each cell, couldn't you just add it to
the column header--then everyone will know that field is.

If you like that idea, you could remove the " years" from each cell by:
Selecting the range
Edit|replace (xl2003 menus)
what: _years (where _ means space character)
with: (leave blank)
replace all

==========
If you don't like that idea, you could still remove the string from each cell,
but then give the column a custom format:

Format|cells|number tab|custom category
#0" years"

Then the value will still be numeric (for further calculations), but the cell
will look pretty.



diana wrote:

I have a spreadsheet in which column b refers to the number of years of safe
driving. ie "22 years". How do I add 1 to each cell in column B?


--

Dave Peterson
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
inverse of the column function? i.e. input a number, output thecorresponding column text label Brotherharry Excel Worksheet Functions 19 February 14th 09 12:37 AM
How do I turn excel columns from column number to column letter? column Setting up and Configuration of Excel 1 April 29th 08 10:15 AM
Count number of cells and total in one column, based on another column suffix Pierre Excel Worksheet Functions 5 October 31st 07 12:28 AM
Display missing Part Number if Column A does not match column B Erik T Excel Worksheet Functions 2 April 17th 06 11:23 PM
Auto number w/ different letter-number combos in same column Colleen B Excel Worksheet Functions 2 February 23rd 05 02:41 PM


All times are GMT +1. The time now is 06:43 AM.

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"