Formula to Populate Text In a Column

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
951
Office Version
  1. 365
Hi,

I have the following table:

Excel Workbook
AB
3Document TypeDocument Number
4Contract12545876
5*12545877
6*12545878
7*12545879
8*12545880
9*12545881
10*12545882
11*12545883
12Title12545884
13*12545885
14*12545886
15*12545887
16*12545888
17*12545889
18*12545890
19*12545891
20*12545892
21*12545893
22*12545894
23Insurance12545895
Sheet4


I am trying to fill the table with the document type as follows:

Excel Workbook
AB
3Document TypeDocument Number
4Contract12545876
5Contract12545877
6Contract12545878
7Contract12545879
8Contract12545880
9Contract12545881
10Contract12545882
11Contract12545883
12Title12545884
13Title12545885
14Title12545886
15Title12545887
16Title12545888
17Title12545889
18Title12545890
19Title12545891
20Title12545892
21Title12545893
22Title12545894
23Insurance12545895
Sheet4


The report that I have is very long - more than 200,000 rows. If I try to fill the blank cells with the document type manually, it takes a very long time. Is there a way to try to build a formula in column C to fill the blanks with the appropriate document type ? The formula should search the column and fill the correct document type accordingly.

Is this possible ? Appreciate all the help.
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi,

If your Document Types as indicated by * are the same as the named Document Type above, then you can just, for example, select "Contract", drag the handle at the lower right corner of the cell and drag down as far as necessary, repeat for other Document Types.
 
Upvote 0
Remove asterisks from Col A then use formula
In C2 and copy down
=LOOKUP("zzz",A$2:A2)


Book1
ABC
1Document TypeDocument NumberNew Column
2Contract12545876Contract
312545877Contract
412545878Contract
512545879Contract
612545880Contract
712545881Contract
812545882Contract
912545883Contract
10Title12545884Title
1112545885Title
1212545886Title
1312545887Title
1412545888Title
1512545889Title
1612545890Title
1712545891Title
1812545892Title
1912545893Title
2012545894Title
21Insurance12545895Insurance
Sheet4
 
Last edited:
Upvote 0
If you really want a formula, then try this:


Excel 2010
ABC
1Document TypeDocument Number
2Contract12545876Contract
3*12545877Contract
4*12545878Contract
5*12545879Contract
6*12545880Contract
7*12545881Contract
8*12545882Contract
9*12545883Contract
10Title12545884Title
11*12545885Title
12*12545886Title
13*12545887Title
14*12545888Title
15*12545889Title
16*12545890Title
17*12545891Title
18*12545892Title
19*12545893Title
20*12545894Title
21Insurance12545895Insurance
Sheet1
Cell Formulas
RangeFormula
C2=IF(A2="*",C1,A2)

Formula copied down.
 
Upvote 0
They're not asterisks, but blanks (a Jeanie flaw)

Thanks for the info, sheetspread.

In that case, change my formula to:


Excel 2010
ABC
1Document TypeDocument Number
2Contract12545876Contract
312545877Contract
412545878Contract
512545879Contract
612545880Contract
712545881Contract
812545882Contract
912545883Contract
10Title12545884Title
1112545885Title
1212545886Title
1312545887Title
1412545888Title
1512545889Title
1612545890Title
1712545891Title
1812545892Title
1912545893Title
2012545894Title
21Insurance12545895Insurance
Sheet1
Cell Formulas
RangeFormula
C2=IF(A2="",C1,A2)

Formula copied down.
 
Upvote 0
This can be done in situ:


Excel 2010
AB
1Document TypeDocument Number
2Contract12545876
312545877
412545878
512545879
612545880
712545881
812545882
912545883
10Title12545884
1112545885
1212545886
1312545887
1412545888
1512545889
1612545890
1712545891
1812545892
1912545893
2012545894
21Insurance12545895
Sheet12


highlight A2:A21, F5-Special-Blanks type =A2, ctrl-enter:


Excel 2010
AB
1Document TypeDocument Number
2Contract12545876
3Contract12545877
4Contract12545878
5Contract12545879
6Contract12545880
7Contract12545881
8Contract12545882
9Contract12545883
10Title12545884
11Title12545885
12Title12545886
13Title12545887
14Title12545888
15Title12545889
16Title12545890
17Title12545891
18Title12545892
19Title12545893
20Title12545894
21Insurance12545895
Sheet12
 
Upvote 0
For those who has Excel version 2013 or higher can use Flash Fill an excel feature.
Simply highlight range A2:A21 and click on Flash Fill
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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