Excel add data to beginning of cell if adjacent cell (to the right) is empty

JONPM

New Member
Joined
Apr 17, 2013
Messages
24
Hi,

Is there a formula I could use which would:

Add data at the beginning of each cell in the left column if and only if the adjacent cell (to the right) is empty.

?? Really struggling with this.

Many thanks,
J
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
this is assuming that you are useing columns ABCd
A and b being what you want to add, and c being the blank cell, d being where you enter the formula.
=if(c1="",sum(b1:a1),"")
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 64, align: right"]2[/TD]
[TD="class: xl63, width: 64, align: right"]3[/TD]
[TD="class: xl63, width: 64, align: right"]1[/TD]
[TD="class: xl63, width: 64"] [/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]2[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63, align: right"]2[/TD]
[TD="class: xl63"] [/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]2[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63"] [/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]2[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63"] [/TD]
[TD="class: xl63, align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]2[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63"] [/TD]
[TD="class: xl63, align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]2[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63, align: right"]4[/TD]
[TD="class: xl63"] [/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]2[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63"] [/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]2[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63"] [/TD]
[TD="class: xl63, align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]2[/TD]
[TD="class: xl63, align: right"]3[/TD]
[TD="class: xl63, align: right"]5[/TD]
[TD="class: xl63"] [/TD]
[/TR]
</tbody>[/TABLE]

this is what I came up with
 
Upvote 0
You can't 'Add' to a cell, that'd make an endless loop referencing itself.

In a third column (Col C), use this (Assuming that col A is your 'Left' column, and B is your 'Right' Column)

"=If(B1="","Added Data"&A1,A1)"

Obviously, change for the correct columns, and either replace 'Added Data' with something else, or a cell reference instead.
 
Upvote 0
I'll try to be more specific.

By 'Add' I mean add to the data in each cell in column B by using a formula which puts the data in (in this case "b.") to all the cells in column B ONLY if there is an adjacent (to the right) blank cell in column C.

[TABLE="class: cms_table, width: 256"]
<tbody>[TR]
[TD="class: cms_table_xl63, width: 64, align: right"][/TD]
[TD="class: cms_table_xl63, width: 64, align: right"]2[/TD]
[TD="class: cms_table_xl63, width: 64, align: right"]3[/TD]
[TD="class: cms_table_xl63, width: 64"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]2[/TD]
[TD="class: cms_table_xl63, align: right"]3[/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]b.2[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]2[/TD]
[TD="class: cms_table_xl63"] 3[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]b.2[/TD]
[TD="class: cms_table_xl63"][/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]2[/TD]
[TD="class: cms_table_xl63, align: right"]3[/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]2[/TD]
[TD="class: cms_table_xl63, align: right"]3[/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]2[/TD]
[TD="class: cms_table_xl63"] 3 [/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]2[/TD]
[TD="class: cms_table_xl63, align: right"]3[/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
basically to put a letter b. into the cells in column B which occur adjacent to blank cells in column C

Thanks — been working on this all day and driving me crazy!!
 
Upvote 0
dates are saved as numbers in excel, if you add the date and a number you are going to get a different date
 
Upvote 0
So there is no way of using a formula to put data (in this case the letter b.) into a cell which has numbers in it based upon the adjacent cells content?

before:

[TABLE="class: cms_table, width: 256"]
<tbody>[TR]
[TD="class: cms_table_xl63, width: 64, align: right"][/TD]
[TD="class: cms_table_xl63, width: 64, align: right"]1930[/TD]
[TD="class: cms_table_xl63, width: 64, align: right"]2006[/TD]
[TD="class: cms_table_xl63, width: 64"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1956[/TD]
[TD="class: cms_table_xl63, align: right"]2004[/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1920[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1918[/TD]
[TD="class: cms_table_xl63"]1987[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1904[/TD]
[TD="class: cms_table_xl63"]1990[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1970[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1968[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1942[/TD]
[TD="class: cms_table_xl63"] 1999[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1870[/TD]
[TD="class: cms_table_xl63, align: right"]1934[/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
</tbody>[/TABLE]


after formula:

[TABLE="class: cms_table, width: 256"]
<tbody>[TR]
[TD="class: cms_table_xl63, width: 64, align: right"][/TD]
[TD="class: cms_table_xl63, width: 64, align: right"]1930[/TD]
[TD="class: cms_table_xl63, width: 64, align: right"]2006[/TD]
[TD="class: cms_table_xl63, width: 64"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1956[/TD]
[TD="class: cms_table_xl63, align: right"]2004[/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]b.1920[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1918[/TD]
[TD="class: cms_table_xl63"]1987[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1904[/TD]
[TD="class: cms_table_xl63"]1990[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]b.1970[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]b.1968[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1942[/TD]
[TD="class: cms_table_xl63"] 1999[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"]1870[/TD]
[TD="class: cms_table_xl63, align: right"]1934[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
closet I've come is (based upon above example):

="b."&B1:B9(IF(ISBLANK(B1:B9),C1:C9,0))

but this doesn't work :/
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top