ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how to populate a 3rd column with with data from 1st or 2nd colum (https://www.excelbanter.com/excel-discussion-misc-queries/69305-how-populate-3rd-column-data-1st-2nd-colum.html)

leo

how to populate a 3rd column with with data from 1st or 2nd colum
 
I have 3 columns of numbers:A,B,C. I want to populate column C with the
number in column A only if there is no number in column B

example
A B C
1 blank 1
2 3 3


how to populate a 3rd column with with data from 1st or 2nd colum
 
Hi

Try this in column C:
=IF(B2="",A2,"")
What do you want in C if B contains a number? If it is B, try this one:
=IF(B2="",A2,B2)

Hope this helps.
Andy.

"leo" wrote in message
...
I have 3 columns of numbers:A,B,C. I want to populate column C with the
number in column A only if there is no number in column B

example
A B C
1 blank 1
2 3 3




grahammal

how to populate a 3rd column with with data from 1st or 2nd colum
 

Sub Button1_Click()
10 For a = 1 To 1000
20 If Sheets("Sheet1").Range("A" & a) = "" Then r = a - 1: GoTo 40 Else
GoTo 30 ' Looks for end of list
30 Next a
40 For b = 1 To r
50 If Sheets("Sheet1").Range("B" & b) = "" Then
Sheets("Sheet1").Range("C" & b) = Sheets("Sheet1").Range("A" & b)
60 Next b
End Sub


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=508073



All times are GMT +1. The time now is 04:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com