Formula to pull numbers from dataset and assign them to rows

photozs

New Member
Joined
Oct 26, 2017
Messages
3
I have huge data set 500,000 rows. Column B contains transaction number (625, 255 etc) and company number (100,200 and 500). C=posting date (C1,C2 etc) or account (C3 etc), D=Amount (summed up in D3 etc), and E=service date (has repeating empty cell).
I need formula to assign company for each row number. The company (red text) is at the bottom of each group (100,200 and 500). For example, in A1 and A2 formula needs to pull 100. In A5 and A6, I need 200 etc.

Currently I filter column E to blanks, select visible cells and copy to column A, then manually copy companies (for example, I copy B3 to A3, than manually A3 to A1 and A2. It takes forever.

I was trying to play with lookup, row, index, if, to assign row number to each company, but nothing worked. I need something that can say search Column E and find a blank space in E3, if Blank pick B3, then move to the next and find blank space in E6 - if blank pull cell b6 etc.
Formula here needed to pull 100
625
9/13/2017
20
4/8/2017
Formula here needed to pull 100
255
5/9/2017
10
5/5/2017
100
5900000000
30
Formula here needed to pull 200
256
8/8/2017
4
6/5/2017
Formula here needed to pull 200
656
9/9/2017
3
3/3/2017
200
5100000000
7
Formula here needed to pull 500
325
8/8/2017
44
5/5/2017
Formula here needed to pull 500
226
4/19/2017
7
3/3/2017
500
5200000000
51

<tbody>
</tbody>
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Re: Need formula to pull numbers from dataset and assign them to rows

photozs, Welcome.

Maybe try the following ARRAY formula...

=IF(ISNUMBER(E1),INDEX(B1:B600000,MATCH(FALSE,ISNUMBER(E1:E600000),0)),"")

Confirm using Ctrl + Shift + Enter

Hope that helps.
 
Upvote 0
Re: Need formula to pull numbers from dataset and assign them to rows

Thanks Snakehips!!! The formula works like magic. I am wondering if we could modify this formula to pull company number from the above?

100
5900000000
30
Formula here needed to pull 100 from B1
256
8/8/2017
4
6/5/2017
Formula here needed to pull 100 from B1
656
9/9/2017
3
3/3/2017
200
5100000000
7
Formula here needed to pull 200 from B4
325
8/8/2017
44
5/5/2017
Formula here needed to pull 200 from B4
226
4/19/2017
7
3/3/2017

<tbody>
</tbody>
 
Upvote 0
Re: Need formula to pull numbers from dataset and assign them to rows

Try formula in A2 and drag down....

Excel 2010
ABCDE
1100590000000030
210025608/08/2017406/05/2017
310065609/09/2017303/03/2017
420051000000007
520032508/08/20174405/05/2017
62002264/19/2017703/03/2017
Sheet3
Cell Formulas
RangeFormula
A2=IF(E2="","",IF(E1="",B1,A1))


Hope that helps.
 
Upvote 0
Re: Need formula to pull numbers from dataset and assign them to rows

It works. Amazing. Thanks a lot!!!!
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,784
Members
449,049
Latest member
greyangel23

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