简体   繁体   中英

Search for the number in a cell then copy a cell from that row to another cell

I need to put the downstream number eg.6.25 (cell L2) into Cell L1. But this has to be found from the database. So if Cell B1 matches anywhere in column B copy the L value from that row and copy to the L column in the original row ie L1. I think that VLookup is what I am trying to do but can't make it work...

PIPE    17888   Upstream   Pit ID   20447   Concrete    Circular Pipe   1/04/2015   380                     6.36    img008.jpg  
PIPE    17888   Downstream Pit ID   22105   Concrete    Circular Pipe   1/04/2015   380         Downstream  6.25    img010.jpg  
PIPE    17854   Downstream Pit ID   22105   Concrete    Circular Pipe   1/04/2015   380         Downstream  6.36    img010.jpg  US PIPE NOT FOUND
PIPE    17811   Upstream   Pit ID   22105   Concrete    Circular Pipe   1/04/2015   380                     6.25    img010.jpg  
PIPE    18105   Downstream Pit ID   23037   Concrete    Circular Pipe   1/04/2015   600         Downstream  5.94    img014.jpg  

IF you can be sure that "Downstream" appears once only for each ID in the B column, you could use SUMIFS, which allows multiple criteria, to find the right values to add into the appropriate cells.

=SUMIFS($L$2:$L$1000,$B$2:$B$1000,B2,$C$2:$C$1000,"Downstream")

Note the specific ID is a non-fixed cell reference - here, B2.

This wouldn't explicitly flag any problems, though; it would just evaluate to zero if no corresponding record was found and would sum the results if two or more matching records were found.

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