# Need a formula to copy value x from a cell in another sheet in row 1 and 2 if the value in another cell equates to certain value

#### reemajhs

##### New Member
I am trying to write a formula with below conditions:

Data in Sheet 1
Vehicle Street
1 Street1
2 Street2
3 Street3
4 Street1
5 Street1

If vehicle1=Street1 copy value in cell Sheet1.A2 in Sheet2.A2
If vehicle1=Street1 copy value in cell Sheet1.A2 in Sheet2.A3
If vehicle2=Street2 copy value in cell Sheet1.A2 in Sheet2.A4
If vehicle3=Street3 copy value in cell Sheet1.A2 in Sheet2.A5
If vehicle4=Street1 copy value in cell Sheet1.A2 in Sheet2.A6
If vehicle4=Street1 copy value in cell Sheet1.A2 in Sheet2.A7

So whereever there is a reference to Street1, I need to copy the text against street1 in two rows and then move on to check if there is no reference to Street1, then copy the cell reference in column A only once.

I tried using CELL, VLOOKUP, IF, INDIRECT but none works consistently.

I tried using a PrevSheet macro but I dont know how to read macro so couldnt modify it as per my requirement.

Any help will be much appreciated

### Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Replies
2
Views
265
Replies
8
Views
124
Replies
6
Views
196
Replies
1
Views
145
Replies
4
Views
156

1,148,158
Messages
5,745,108
Members
423,924
Latest member
Gazzat

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