Sheet 1 has Month, Day and Year while Sheet 2 has Year and Day. If the data of Year in Sheet 1 and 2 are matched I want to copy the Day values from Sheet 1 to Sheet 2. Is it done by VLookup and how?
-
1Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.– Community BotCommented Dec 13, 2023 at 19:06
-
What do you expect to see in column B of Sheet2?– FlexYourDataCommented Dec 13, 2023 at 21:26
Add a comment
|
1 Answer
You could use vlookup
, however you would need to have your search criteria in the first column from your range to be searched, eg Sheet 1
as :
_ | A | B | C
--- | --- | --- | ---
1 |
2 | Year | Month | Day
3 | 1988 | 12 | 25
...
Then you could use the formula:
sheet2!B3 = vlookup(A3,sheet1!a2:c7,3,0)
Yet I prefer index(match())
, more flexible, and typically with your example, you can use it without reordering columns:
sheet2!B3 = index(sheet1!B:B,match(A3,sheet1!C:C,0))