# Newbie question! Pasting records associated with SOME dates between worksheets

#### alexemberey

##### New Member
Hi guys - hope everyone's well! Newbie here...

I have one worksheet where there are records (rows) with 4 fields (columns) for 8 days in a month, but none of the others.

I have another, pre-existing worksheet where there need to be records for ALL days, even if the values returned for each field are 0.

How can I paste the 8 records into the second worksheet as simply as possible, without manually matching each record to the correct date?

Alex

### Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

#### RonB1111

##### Well-known Member
Use VLOOKUP formula. Here's a link explaining it: Excel VLookup Function Examples

If you need help creating the formula, please post sample data showing names of sheets and columns and row where data starts/ends.

Your final formula in B2 of your pre-existing sheet will look something like:
=IFERROR(VLOOKUP(A2,Sheet1!\$A\$2:\$A\$1000,2,FALSE),0)
This assumes the 1st worksheet described is named Sheet1 and the dates are in A2 thru A1000 and the 3 other fields are in Cols B, C, & D
You'd change the 2 to 3 for C2, and to 4 for D2 then copy the formulas down to the end of data. Of course you'll need to adjust the names/ranges to suit your actual data.

#### alexemberey

##### New Member
Thanks so much Ron!

In the end I used IF(ISNA(VLOOKUP ....),0,VLOOKUP).

Thanks again! Alex

#### RonB1111

##### Well-known Member
You're welcome. Thank you for providing feedback.

If you're using Excel 2003 or earlier, you'd have to use the IF(ISNA(VLOOKUP ....),0,VLOOKUP). If you use Excel 2007+, you have the option of using the shorter IFERROR(VLOOLUP....),0)

Replies
0
Views
222
Replies
4
Views
271
Replies
1
Views
367
Replies
3
Views
226
Replies
10
Views
445

1,195,992
Messages
6,012,740
Members
441,724
Latest member
Aalbid

### 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.

### Which adblocker are you using?

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

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