Copy value from cell above if blank

Mux99

New Member
Joined
Apr 15, 2019
Messages
25
In column A every two cells are merged (A1 with A2, A3 with A4 etc...) so my formula only works properly for odd number rows. I need the below to use the value from the cell above if A6 is empty and so on.

=IF(Sheet1!$B6<>"", Sheet1!$A6,"")
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,692
Maybe:
Code:
=IF(Sheet1!$B6<>"", IF(MOD(ROW(Sheet1!A6),2)=0,Sheet1!$A5,""))
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,649
Office Version
365
Platform
Windows
Maybe
=IF(Sheet1!$A6="",Sheet1!$A5,Sheet1!A6)
 

Mux99

New Member
Joined
Apr 15, 2019
Messages
25
Maybe
=IF(Sheet1!$A6="",Sheet1!$A5,Sheet1!A6)
Also did not work for what I'm trying to do but maybe it's my fault as maybe I wasn't clear enough with what I need. Ignore my first post and see the examples below. I need a formula to output the same results as in Sheet2.

In Sheet2 Column B I'm using the formula and it works perfectly. =IF(Sheet1!$B1<>"", Sheet1!$B1,"")

I need some help with the column A formula as the following only works with odd number rows. =IF(Sheet1!$B1<>"", Sheet1!$A1,"")


Sheet1AB
1Name1500
2
3Name2
4
5Name3600
6300
7Name4
8400

<tbody>
</tbody>


Sheet2AB
1Name1500
2
3
4
5Name3600
6Name3300
7
8Name4400

<tbody>
</tbody>
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
43,522
Office Version
365
Platform
Windows
In cell A1 of Sheet2, try this formula and copy down.

=IF(Sheet1!B1="","",LOOKUP("zzz",Sheet1!A$1:A1))
 

Mux99

New Member
Joined
Apr 15, 2019
Messages
25
In cell A1 of Sheet2, try this formula and copy down.

=IF(Sheet1!B1="","",LOOKUP("zzz",Sheet1!A$1:A1))
Thanks. This one worked but I already got it working with the formula below.

=IF(Sheet1!$B2<>"",IF(Sheet1!$A2<>"",Sheet1!$A2,Sheet1!$A1),"")
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
43,522
Office Version
365
Platform
Windows
Thanks. This one worked but I already got it working with the formula below.

=IF(Sheet1!$B2<>"",IF(Sheet1!$A2<>"",Sheet1!$A2,Sheet1!$A1),"")
That sort of indicates that in fact your data & results probably actually start on row 2 of each sheet, not row 1 as indicated in your tables in post 5? (Or else that formula is entered on row 2 of Sheet2 and copied up to row 1 which, while working actually creates a #REF ! error in the formula.

If everything (apart from any headings) actually starts on row 2, then you could also use this simpler version in A2 of Sheet2, copied down

=IF(Sheet1!B2="","",Sheet1!A1&Sheet1!A2)
 
Last edited:

Forum statistics

Threads
1,089,563
Messages
5,409,005
Members
403,247
Latest member
prabutr28

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top