If cell is blank, take value from another cell

strtru

New Member
Joined
Feb 4, 2019
Messages
1
Hello all,

I am looking for a way to do this:

If a cell in a column is blank, I want to take the value from the cell to the left of that cell, and put that cell's value into another sheet. How can I do this?

Thank you for any help!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Excel 2010
AB
AAA
BBB
CCC
DDD

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: right"]405[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"]366[/TD]

[TD="align: center"]3[/TD]

[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"][/TD]

[TD="align: center"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"]274[/TD]

[TD="align: center"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"]288[/TD]

[TD="align: center"]7[/TD]

[TD="align: right"][/TD]

[TD="align: center"]8[/TD]
[TD="align: right"][/TD]
[TD="align: right"]150[/TD]

[TD="align: center"]9[/TD]

[TD="align: right"][/TD]

[TD="align: center"]10[/TD]
[TD="align: right"][/TD]
[TD="align: right"]266[/TD]

</tbody>
Sheet1



Excel 2010
AB
AAA
BBB
CCC
DDD

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: right"]405[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"]366[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"]274[/TD]

[TD="align: center"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"]288[/TD]

[TD="align: center"]7[/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]
[TD="align: right"][/TD]
[TD="align: right"]150[/TD]

[TD="align: center"]9[/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]
[TD="align: right"][/TD]
[TD="align: right"]266[/TD]

</tbody>
Sheet2

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B1[/TH]
[TD="align: left"]=IF(Sheet1!B1<>"",Sheet1!B1,Sheet1!A1)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Copy down Cell B1
 
Upvote 0
Hello all,

I am looking for a way to do this:

If a cell in a column is blank, I want to take the value from the cell to the left of that cell, and put that cell's value into another sheet. How can I do this?

Thank you for any help!
Hello Strtru

WELCOME to the site.
I may have something that will be of use to you, however, without knowing a few details of what you are looking for, it will be almost impossible for me to modify what I have to fit your needs. In the future, it is better for all concerned if you could give a few specific details of what you have and what your needs are. It helps us help you if we know:
1. What the sheet names are?
2. What specific cell address or columns are involved for both your source data and destination data.
3. Are you looking for an Excel formula or a VBA macro?
4. If you have any code, show it to us, even if it doesn't work.
5. If the code isn't working, where does it stop and what are the error messages?
6. It's also a big help to us if you can show us a few (even half a dozen or so) rows of your source data and what you expect the end results to be. If your data is confidential, make up some representative data. This gives us a better 'picture' of what we are dealing with.

Always keep in mind that while your needs and problems are clear to you, all we have is whatever you tell us. The more precise information we have, the faster and better we may be able to give you a solution to your problem. In most cases, it is better if you tell us something that doesn't apply or that we don't need, than it is to not tell us and then we have to write to you to get that information. With everything I've said, I'm going to make a wild guess at what you are looking for. You may have to make some adjustment as to rows, columns, and sheets. If you aren't sure how to do that, then if you can answer the questions I've asked, I'll be happy to make any changes for you. If you're looking for a VBA solution, I think I have something there too, but it will need a few modifications.

I'm assuming your original data is starting in row 2 of columns 'A' and 'B' on 'SHEET1'. If there is a blank cell in column 'B', then you want the value from 'A' of that same row transferred to column 'B', starting in row 2 of 'SHEET2'. Place the following formula in row 2 of column 'B' on SHEET2, and then copy it down as far as needed.
Code:
=IF(Sheet1!B2="",Sheet1!A2,"")
Once again, WELCOME to the site. I hope this has been of some help to you, but if not, let us know. I see that Jim May has offered a solution, however, the results of mine will be slightly different. You can pick whichever gives the end results you want.

TotallyConfused
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

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