Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF function
Hi,
I have a column where some values contain 0 (zero). I want to create an IF function, where, IF the value is 0 THEN change it to 1, ELSE do nothing (i.e. retain the original cell value). Thoughts... TIA |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF function
Are you wanting to do this "in place" or do you need a formula in a
different cell? Formula in a different cell: =IF(ISNUMBER(A1),IF(A1=0,1,A1),"") Biff "Rob" wrote in message ... Hi, I have a column where some values contain 0 (zero). I want to create an IF function, where, IF the value is 0 THEN change it to 1, ELSE do nothing (i.e. retain the original cell value). Thoughts... TIA |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF function
In place. So if A1 has a value of 132, I'd want to retain that value, whereas
if the next cell below, A2, had a 0 value, then have it changed to a 1. Thanks. "T. Valko" wrote: Are you wanting to do this "in place" or do you need a formula in a different cell? Formula in a different cell: =IF(ISNUMBER(A1),IF(A1=0,1,A1),"") Biff "Rob" wrote in message ... Hi, I have a column where some values contain 0 (zero). I want to create an IF function, where, IF the value is 0 THEN change it to 1, ELSE do nothing (i.e. retain the original cell value). Thoughts... TIA |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF function
To do it in place you'll need to use a VBA procedure. I can't help you with
that. Biff "Rob" wrote in message ... In place. So if A1 has a value of 132, I'd want to retain that value, whereas if the next cell below, A2, had a 0 value, then have it changed to a 1. Thanks. "T. Valko" wrote: Are you wanting to do this "in place" or do you need a formula in a different cell? Formula in a different cell: =IF(ISNUMBER(A1),IF(A1=0,1,A1),"") Biff "Rob" wrote in message ... Hi, I have a column where some values contain 0 (zero). I want to create an IF function, where, IF the value is 0 THEN change it to 1, ELSE do nothing (i.e. retain the original cell value). Thoughts... TIA |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF function
Hi Rob
This short piece of code posted below will do that. First, mark the range of cells where you want the conversion to take place, then run the macro. You will need to copy the code to your workbook, instructions follow the code Sub ChangeZerotoOne() Dim c As Range For Each c In Selection If c.Value = 0 Then c.Value = 1 Next c End Sub You can copy the code and paste it into your Visual Basic Editor (VBE) in a Standard Module located in your file. To do this, Alt + F11 (open VBE) Ctrl + R (open Project Explorer) Select the file name on the left Insert Module Paste code in Module David McRitchie has lots of useful help on his site at http://www.mvps.org/dmcritchie/excel/install.htm http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Regards Roger Govier "Rob" wrote in message ... In place. So if A1 has a value of 132, I'd want to retain that value, whereas if the next cell below, A2, had a 0 value, then have it changed to a 1. Thanks. "T. Valko" wrote: Are you wanting to do this "in place" or do you need a formula in a different cell? Formula in a different cell: =IF(ISNUMBER(A1),IF(A1=0,1,A1),"") Biff "Rob" wrote in message ... Hi, I have a column where some values contain 0 (zero). I want to create an IF function, where, IF the value is 0 THEN change it to 1, ELSE do nothing (i.e. retain the original cell value). Thoughts... TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need some comments on my Utility_Move class module. | Excel Worksheet Functions | |||
Creating a Custom Excel Function to Calculate Gini Coefficients | Excel Worksheet Functions | |||
Date & Time | New Users to Excel | |||
Conversion | Excel Worksheet Functions | |||
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. | Excel Worksheet Functions |