简体   繁体   中英

If B2 in sheet 1 matches any cell on sheet 3, copy the next cell from sheet 3. (copying to sheet 1)

Anyone who could give me the excel formula for this? Thank you!

If B2 in sheet 1 matches any cell from column A of Sheet 3, copy the cell found on the right of that (column B).

Copying to a cell in sheet 1.

Thanks! (I hope this isn't too confusing.)

For example B2 is "8 December". Then there is a list of dates on Column A of Sheet 3. On column B of sheet 3 is a corresponding time. So for example, on the right of 8 December on Sheet 3 is 8:30, I want that to be copied on the cell I'm making a formula on.

Some folk use the LOOKUP function for this, but I like to use MATCH and INDEX because it gives you more freedom for more advanced formula (such as checking if there was a match or not) and has less requirements (such as data doesn't need to be sorted).

=INDEX(Sheet3!B:B, MATCH(Sheet1!B2, Sheet3!A:A, 0))

If you break it down into the parts, MATCH(Sheet1!B2, Sheet3!A:A, 0) returns the row number for the first matching cell in column A of sheet Sheet3. Then INDEX(Sheet3!B:B, ...) returns the value of the cell in column B of sheet Sheet3 at a specified row number.

If nothing matched, then you'll get a #NA error value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM