Copying Non-Blank Cell Values In A Column Down to Fill Blank Cells with Same Value Until New Non-Blank Value Appears

Aimee S.

Board Regular
Joined
Sep 28, 2010
Messages
236
Office Version
  1. 365
Platform
  1. Windows
Hi Folks. I have a good thousand or two rows of data that looks something like this. The first column is utilizing formula:

=IF(AND(ISERROR(SEARCH("-",D3)),LEN(D3)>6),D3,"")

to pull only names from Column B, otherwise returning blanks.

What I ultimately need is for column A to have, for example (in the first two rows), the name 'Schultz, Paul' populated for the first two rows until a new name (Crawford, Benny) appears, then repeat.

So if you see a 6-digit ID # in the second column, I need the formula to populate in Column A the Last, First name of the person to the immediate left of the 6-digit ID #. For example, the first digit 800187 should show Schultz, Paul to the left in Column A and so forth. :eek:/ Halp?


Here is what the data originally looks like:
Schultz, Paul
800187
Crawford, Benny
800638
Smith, Tim
800144
NS-ISP IMPLEMENTATION
Alt, Michael
795979
Faircloth, Larry
795403
800769
800014
799261
800763

<tbody>
</tbody>


Here is what I need the data to look like, with Column A populated via formulas.
Schultz, PaulSchultz, Paul
Schultz, Paul800187
Crawford, BennyCrawford, Benny
Crawford, Benny800638
Smith, TimSmith, Tim
Smith, Tim800144
NS-ISP IMPLEMENTATIONNS-ISP IMPLEMENTATION
Alt, MichaelAlt, Michael
Alt, Michael795979
Faircloth, LarryFaircloth, Larry
Faircloth, Larry795403
Faircloth, Larry800769
Faircloth, Larry800014
Faircloth, Larry799261
Faircloth, Larry800763

<tbody>
</tbody>
 
Last edited:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Assuming your data begins in cell B3 (you were using column D in your formula), you could place this formula in cell A3:
Code:
=B3
and then enter this formula in cell A4 and copy down for all rows:
Code:
=IF(ISNUMBER(B4+0),A3,B4)
 
Upvote 0
You are right about the Columns - sorry about that - I made them A and B for the purposes of this post and forgot to update the formula.

Your solution is great! I just had one question - would it be possible to include in the formula you provided:

If value in B3 contains a "-" (a hyphen), make A3 blank, otherwise your formula kicks in? So it would look like this:

NS-MARKET IMPLEMENTATION
Schultz, PaulSchultz, Paul
Schultz, Paul800187
Crawford, BennyCrawford, Benny
Crawford, Benny800638
Smith, TimSmith, Tim
Smith, Tim800144
NS-ISP IMPLEMENTATION
Alt, MichaelAlt, Michael
Alt, Michael795979

<tbody>
</tbody><colgroup><col><col></colgroup>




Assuming your data begins in cell B3 (you were using column D in your formula), you could place this formula in cell A3:
Code:
=B3
and then enter this formula in cell A4 and copy down for all rows:
Code:
=IF(ISNUMBER(B4+0),A3,B4)
 
Upvote 0
Just incorporate some of the logic you were using before:
Code:
=IF(ISNUMBER(B4+0),A3,IF(ISNUMBER(SEARCH("-",B4)),"",B4))
 
Upvote 0
Thanks so much, Joe! Yes, I tried but was getting an error value returned because I didn't include the ISNUMBER in the hyphen SEARCH part of the nested IF. Whoopsy.

You saved me a lot of pain today. SOLVED! Thanks again (and great avatar by the by - I grew up on Calvin and Hobbes and I am proud to say my world view was in part molded by Bill Watterson) ^_^


Just incorporate some of the logic you were using before:
Code:
=IF(ISNUMBER(B4+0),A3,IF(ISNUMBER(SEARCH("-",B4)),"",B4))
 
Upvote 0
You are welcome!

Always great to find another C&H fan!
:cool:
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,691
Members
449,117
Latest member
Aaagu

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