How to search cells that are blank and copy the last cell above

shegre

New Member
Joined
Aug 11, 2011
Messages
8
What formula can I use that searches through an array of cells and checks if the cell is empty or not. If the cell is not empty it returns the value in that cell. If the cell is empty it copies the cell above it that is not empty.

The first cell that is checked will never be empty.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
What formula can I use that searches through an array of cells and checks if the cell is empty or not. If the cell is not empty it returns the value in that cell. If the cell is empty it copies the cell above it that is not empty.

The first cell that is checked will never be empty.
Where is this data range? Is it a single row or column? Where do you want the results to appear?
 
Upvote 0
"Manual" method to copy values to a vertical range.
Select Range you want to Fill
On the Home tab, in the Editing group, click Find & Select, and then click Go To.
(Keyboard shortcut*for Go To is CTRL+G)
Click Special…
Blanks | OK
Hit the "=" key. Hit the Up arrow. Hold down Ctrl and hit Enter.
(you now have a formula in each blank cell)
Select Range again, not just blank cell range.
Crl-C to copy
In the Home tab, Click Paste Icon dropdown arrow
Click Paste Values
(you will now have the values in each former blank cell)
 
Upvote 0
As the data can vary in size, I would like the formula to check all of Column C.

So single column, multiple rows.

The formula will be in a cell in a different sheet (same workbook)

Using Excel 2007 - forgot to mention
 
Upvote 0
The steps I posted above will input a formula in all blank cells of the Selected range.
The steps also copy and paste "Values" into the cells. You can skip that part if desired. Then cells with existing data or formulas will not be affected.
 
Upvote 0
Datsmart

The formula in the cell that was blank is =C10, which is the cell above it that has data, however, I don't want to do this manually. I am looking for a formula that checks a cell if it is empty or not and if it is, it copies the cell from above.
 
Upvote 0
I am not sure what you really need.
Can you post a before and after sample of data and what you expect it to change to after a formula is added?
 
Upvote 0
I am trying to create a report (report 1 below) in one worksheet that requires particular data from another report (report 2 below) in another worksheet (this report is copied from an auto-generated report from an application). I need a formula that will check 3 cells in report 2 (A1, B1, & D1) and copy the data from cell G1 into Report 1, C4 (as B4 in Report 1 = D1 in Report 2)

Report 1
<TABLE dir=ltr border=1 cellSpacing=0 borderColor=#000000 cellPadding=2 width=410><TBODY><TR><TD height=24 width="27%">
A​
</TD><TD height=24 width="23%">B
</TD><TD height=24 width="13%">C
</TD><TD height=24 width="23%">
D​
</TD><TD height=24 width="15%">E
</TD></TR></TBODY></TABLE>
<TABLE dir=ltr border=1 cellSpacing=0 borderColor=#000000 cellPadding=2 width=410><TBODY><TR><TD height=24 width="27%">
State:​
</TD><TD height=24 width="23%">
Available​
</TD><TD height=24 width="13%">
</TD><TD height=24 width="23%">
Duration:​
</TD><TD height=24 width="15%">
</TD></TR><TR><TD height=24 width="27%">
</TD><TD height=24 width="23%">
0: No Reason​
</TD><TD height=24 width="13%">
</TD><TD height=24 width="23%">
</TD><TD height=24 width="15%">
</TD></TR><TR><TD height=24 width="27%">
</TD><TD height=24 width="23%">
1: Finishing Call​
</TD><TD height=24 width="13%">
</TD><TD height=24 width="23%">
</TD><TD height=24 width="15%">
</TD></TR><TR><TD height=24 width="27%">
</TD><TD height=24 width="23%">
2: Break​
</TD><TD height=24 width="13%">
</TD><TD height=24 width="23%">
</TD><TD height=24 width="15%">
34:53:02​
</TD></TR><TR><TD height=24 width="27%">
</TD><TD height=24 width="36%" colSpan=2>
3: Coordinating/Dispatching​
</TD><TD height=24 width="23%">
</TD><TD height=24 width="15%">
</TD></TR><TR><TD height=24 width="27%">
</TD><TD height=24 width="36%" colSpan=2>
4: Meeting/Con. Call​
</TD><TD height=24 width="23%">
</TD><TD height=24 width="15%">
</TD></TR><TR><TD height=24 width="27%">
</TD><TD height=24 width="23%">
5: Voicemail/Email​
</TD><TD height=24 width="13%">
</TD><TD height=24 width="23%">
</TD><TD height=24 width="15%">
</TD></TR><TR><TD height=24 width="27%">
</TD><TD height=24 width="23%">
6: Project​
</TD><TD height=24 width="13%">
</TD><TD height=24 width="23%">
</TD><TD height=24 width="15%">
</TD></TR><TR><TD height=24 width="27%">
</TD><TD height=24 width="36%" colSpan=2>
7: High Priority/Immed Term​
</TD><TD height=24 width="23%">
</TD><TD height=24 width="15%">
</TD></TR><TR><TD height=24 width="27%">
</TD><TD height=24 width="23%">
8: Peer Support​
</TD><TD height=24 width="13%">
</TD><TD height=24 width="23%">
</TD><TD height=24 width="15%">
</TD></TR></TBODY></TABLE>

Report 2
<TABLE dir=ltr border=1 cellSpacing=2 borderColor=#000000 cellPadding=2 width=503><TBODY><TR><TD height=15 width="12%">
A​
</TD><TD height=15 width="15%">
B​
</TD><TD height=15 width="12%">
C​
</TD><TD height=15 width="12%">
D​
</TD><TD height=15 width="25%">
E​
</TD><TD height=15 width="12%">
F​
</TD><TD height=15 width="12%">
G​
</TD></TR></TBODY></TABLE>
<TABLE dir=ltr border=1 cellSpacing=2 borderColor=#000000 cellPadding=2 width=503><TBODY><TR><TD height=15 width="12%">
1341​
</TD><TD height=15 width="15%">
Agent 1​
</TD><TD height=15 width="12%">
177:15:15​
</TD><TD height=15 width="12%">
2​
</TD><TD height=15 width="25%">
Break​
</TD><TD height=15 width="12%">
1​
</TD><TD height=15 width="12%">
0:00:42​
</TD></TR><TR><TD height=15 width="12%">
</TD><TD height=15 width="15%">
</TD><TD height=15 width="12%">
177:15:15​
</TD><TD height=15 width="12%">
0​
</TD><TD height=15 width="25%">
No Reason Code​
</TD><TD height=15 width="12%">
104​
</TD><TD height=15 width="12%">
34:53:02​
</TD></TR><TR><TD height=15 width="12%">
1342​
</TD><TD height=15 width="15%">
Agent 2​
</TD><TD height=15 width="12%">
0:18:53​
</TD><TD height=15 width="12%">
0​
</TD><TD height=15 width="25%">
No Reason Code​
</TD><TD height=15 width="12%">
1​
</TD><TD height=15 width="12%">
0:00:07​
</TD></TR><TR><TD height=15 width="12%">
1343​
</TD><TD height=15 width="15%">
Agent 3​
</TD><TD height=15 width="12%">
148:42:48​
</TD><TD height=15 width="12%">
4​
</TD><TD height=15 width="25%">
Meeting / Con. Call​
</TD><TD height=15 width="12%">
1​
</TD><TD height=15 width="12%">
0:00:04​
</TD></TR><TR><TD height=15 width="12%">
</TD><TD height=15 width="15%">
</TD><TD height=15 width="12%">
148:42:48​
</TD><TD height=15 width="12%">
2​
</TD><TD height=15 width="25%">
Break​
</TD><TD height=15 width="12%">
2​
</TD><TD height=15 width="12%">
0:03:13​
</TD></TR><TR><TD height=15 width="12%">
</TD><TD height=15 width="15%">
</TD><TD height=15 width="12%">
148:42:48​
</TD><TD height=15 width="12%">
3​
</TD><TD height=15 width="25%">
Coordinating / Dispatching​
</TD><TD height=15 width="12%">
1​
</TD><TD height=15 width="12%">
0:00:04​
</TD></TR><TR><TD height=15 width="12%">
</TD><TD height=15 width="15%">
</TD><TD height=15 width="12%">
148:42:48​
</TD><TD height=15 width="12%">
0​
</TD><TD height=15 width="25%">
No Reason Code​
</TD><TD height=15 width="12%">
93​
</TD><TD height=15 width="12%">
110:04:50​
</TD></TR><TR><TD height=15 width="12%">
</TD><TD height=15 width="15%">
</TD><TD height=15 width="12%">
148:42:48​
</TD><TD height=15 width="12%">
6​
</TD><TD height=15 width="25%">
Project​
</TD><TD height=15 width="12%">
1​
</TD><TD height=15 width="12%">
0:00:04​
</TD></TR><TR><TD height=15 width="12%">
</TD><TD height=15 width="15%">
</TD><TD height=15 width="12%">
148:42:48​
</TD><TD height=15 width="12%">
1​
</TD><TD height=15 width="25%">
Finishing Call​
</TD><TD height=15 width="12%">
1​
</TD><TD height=15 width="12%">
0:00:05​
</TD></TR><TR><TD height=15 width="12%">
</TD><TD height=15 width="15%">
</TD><TD height=15 width="12%">
148:42:48​
</TD><TD height=15 width="12%">
5​
</TD><TD height=15 width="25%">
Voicemail / Email​
</TD><TD height=15 width="12%">
1​
</TD><TD height=15 width="12%">
0:00:03​
</TD></TR><TR><TD height=15 width="12%">
1346​
</TD><TD height=15 width="15%">
Agent 4​
</TD><TD height=15 width="12%">
167:32:24​
</TD><TD height=15 width="12%">
2​
</TD><TD height=15 width="25%">
Break​
</TD><TD height=15 width="12%">
1​
</TD><TD height=15 width="12%">
0:59:40​
</TD></TR><TR><TD height=15 width="12%">
</TD><TD height=15 width="15%">
</TD><TD height=15 width="12%">
167:32:24​
</TD><TD height=15 width="12%">
0​
</TD><TD height=15 width="25%">
No Reason Code​
</TD><TD height=15 width="12%">
99​
</TD><TD height=15 width="12%">
26:26:50​
</TD></TR><TR><TD height=16 width="12%">
1349​
</TD><TD height=16 width="15%">
Agent 5​
</TD><TD height=16 width="12%">
35:09:46​
</TD><TD height=16 width="12%">
0​
</TD><TD height=16 width="25%">
No Reason Code​
</TD><TD height=16 width="12%">
26​
</TD><TD height=16 width="12%">
6:59:52​
</TD></TR></TBODY></TABLE>
 
Upvote 0
I am trying to create a report (report 1 below) in one worksheet that requires particular data from another report (report 2 below) in another worksheet (this report is copied from an auto-generated report from an application). I need a formula that will check 3 cells in report 2 (A1, B1, & D1) and copy the data from cell G1 into Report 1, C4 (as B4 in Report 1 = D1 in Report 2)

Report 1
<TABLE dir=ltr borderColor=#000000 cellSpacing=0 cellPadding=2 width=410 border=1><TBODY><TR><TD width="27%" height=24>A

</TD><TD width="23%" height=24>B

</TD><TD width="13%" height=24>C
</TD><TD width="23%" height=24>D

</TD><TD width="15%" height=24>E

</TD></TR></TBODY></TABLE>
<TABLE dir=ltr borderColor=#000000 cellSpacing=0 cellPadding=2 width=410 border=1><TBODY><TR><TD width="27%" height=24>State:
</TD><TD width="23%" height=24>Available

</TD><TD width="13%" height=24>
</TD><TD width="23%" height=24>Duration:

</TD><TD width="15%" height=24>

</TD></TR><TR><TD width="27%" height=24>
</TD><TD width="23%" height=24>0: No Reason

</TD><TD width="13%" height=24>

</TD><TD width="23%" height=24>

</TD><TD width="15%" height=24>

</TD></TR><TR><TD width="27%" height=24>
</TD><TD width="23%" height=24>1: Finishing Call

</TD><TD width="13%" height=24>

</TD><TD width="23%" height=24>

</TD><TD width="15%" height=24>

</TD></TR><TR><TD width="27%" height=24>
</TD><TD width="23%" height=24>2: Break

</TD><TD width="13%" height=24>

</TD><TD width="23%" height=24>
</TD><TD width="15%" height=24>34:53:02

</TD></TR><TR><TD width="27%" height=24>
</TD><TD width="36%" colSpan=2 height=24>3: Coordinating/Dispatching

</TD><TD width="23%" height=24>

</TD><TD width="15%" height=24>

</TD></TR><TR><TD width="27%" height=24>
</TD><TD width="36%" colSpan=2 height=24>4: Meeting/Con. Call

</TD><TD width="23%" height=24>

</TD><TD width="15%" height=24>

</TD></TR><TR><TD width="27%" height=24>
</TD><TD width="23%" height=24>5: Voicemail/Email

</TD><TD width="13%" height=24>

</TD><TD width="23%" height=24>

</TD><TD width="15%" height=24>

</TD></TR><TR><TD width="27%" height=24>
</TD><TD width="23%" height=24>6: Project

</TD><TD width="13%" height=24>

</TD><TD width="23%" height=24>

</TD><TD width="15%" height=24>

</TD></TR><TR><TD width="27%" height=24>
</TD><TD width="36%" colSpan=2 height=24>7: High Priority/Immed Term

</TD><TD width="23%" height=24>

</TD><TD width="15%" height=24>

</TD></TR><TR><TD width="27%" height=24>
</TD><TD width="23%" height=24>8: Peer Support

</TD><TD width="13%" height=24>

</TD><TD width="23%" height=24>

</TD><TD width="15%" height=24>

</TD></TR></TBODY></TABLE>​

Report 2
<TABLE dir=ltr borderColor=#000000 cellSpacing=2 cellPadding=2 width=503 border=1><TBODY><TR><TD width="12%" height=15>A
</TD><TD width="15%" height=15>B
</TD><TD width="12%" height=15>C
</TD><TD width="12%" height=15>D
</TD><TD width="25%" height=15>E
</TD><TD width="12%" height=15>F
</TD><TD width="12%" height=15>G

</TD></TR></TBODY></TABLE>
<TABLE dir=ltr borderColor=#000000 cellSpacing=2 cellPadding=2 width=503 border=1><TBODY><TR><TD width="12%" height=15>1341
</TD><TD width="15%" height=15>Agent 1
</TD><TD width="12%" height=15>177:15:15
</TD><TD width="12%" height=15>2
</TD><TD width="25%" height=15>Break
</TD><TD width="12%" height=15>1
</TD><TD width="12%" height=15>0:00:42

</TD></TR><TR><TD width="12%" height=15>

</TD><TD width="15%" height=15>
</TD><TD width="12%" height=15>177:15:15
</TD><TD width="12%" height=15>0
</TD><TD width="25%" height=15>No Reason Code
</TD><TD width="12%" height=15>104
</TD><TD width="12%" height=15>34:53:02
</TD></TR><TR><TD width="12%" height=15>1342
</TD><TD width="15%" height=15>Agent 2
</TD><TD width="12%" height=15>0:18:53
</TD><TD width="12%" height=15>0
</TD><TD width="25%" height=15>No Reason Code
</TD><TD width="12%" height=15>1
</TD><TD width="12%" height=15>0:00:07
</TD></TR><TR><TD width="12%" height=15>1343
</TD><TD width="15%" height=15>Agent 3
</TD><TD width="12%" height=15>148:42:48
</TD><TD width="12%" height=15>4
</TD><TD width="25%" height=15>Meeting / Con. Call
</TD><TD width="12%" height=15>1
</TD><TD width="12%" height=15>0:00:04

</TD></TR><TR><TD width="12%" height=15>

</TD><TD width="15%" height=15>
</TD><TD width="12%" height=15>148:42:48
</TD><TD width="12%" height=15>2
</TD><TD width="25%" height=15>Break
</TD><TD width="12%" height=15>2
</TD><TD width="12%" height=15>0:03:13

</TD></TR><TR><TD width="12%" height=15>

</TD><TD width="15%" height=15>
</TD><TD width="12%" height=15>148:42:48
</TD><TD width="12%" height=15>3
</TD><TD width="25%" height=15>Coordinating / Dispatching
</TD><TD width="12%" height=15>1
</TD><TD width="12%" height=15>0:00:04

</TD></TR><TR><TD width="12%" height=15>

</TD><TD width="15%" height=15>
</TD><TD width="12%" height=15>148:42:48
</TD><TD width="12%" height=15>0
</TD><TD width="25%" height=15>No Reason Code
</TD><TD width="12%" height=15>93
</TD><TD width="12%" height=15>110:04:50

</TD></TR><TR><TD width="12%" height=15>

</TD><TD width="15%" height=15>
</TD><TD width="12%" height=15>148:42:48
</TD><TD width="12%" height=15>6
</TD><TD width="25%" height=15>Project
</TD><TD width="12%" height=15>1
</TD><TD width="12%" height=15>0:00:04

</TD></TR><TR><TD width="12%" height=15>

</TD><TD width="15%" height=15>
</TD><TD width="12%" height=15>148:42:48
</TD><TD width="12%" height=15>1
</TD><TD width="25%" height=15>Finishing Call
</TD><TD width="12%" height=15>1
</TD><TD width="12%" height=15>0:00:05

</TD></TR><TR><TD width="12%" height=15>

</TD><TD width="15%" height=15>
</TD><TD width="12%" height=15>148:42:48
</TD><TD width="12%" height=15>5
</TD><TD width="25%" height=15>Voicemail / Email
</TD><TD width="12%" height=15>1
</TD><TD width="12%" height=15>0:00:03
</TD></TR><TR><TD width="12%" height=15>1346
</TD><TD width="15%" height=15>Agent 4
</TD><TD width="12%" height=15>167:32:24
</TD><TD width="12%" height=15>2
</TD><TD width="25%" height=15>Break
</TD><TD width="12%" height=15>1
</TD><TD width="12%" height=15>0:59:40

</TD></TR><TR><TD width="12%" height=15>

</TD><TD width="15%" height=15>
</TD><TD width="12%" height=15>167:32:24
</TD><TD width="12%" height=15>0
</TD><TD width="25%" height=15>No Reason Code
</TD><TD width="12%" height=15>99
</TD><TD width="12%" height=15>26:26:50
</TD></TR><TR><TD width="12%" height=16>1349
</TD><TD width="15%" height=16>Agent 5
</TD><TD width="12%" height=16>35:09:46
</TD><TD width="12%" height=16>0
</TD><TD width="25%" height=16>No Reason Code
</TD><TD width="12%" height=16>26
</TD><TD width="12%" height=16>6:59:52

</TD></TR></TBODY></TABLE>​
Sorry, I'm lost! :confused:
 
Upvote 0

Forum statistics

Threads
1,224,541
Messages
6,179,418
Members
452,912
Latest member
alicemil

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