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
Joined
Sep 8, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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

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

Forum statistics

Threads
1,214,981
Messages
6,122,565
Members
449,089
Latest member
Motoracer88

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