Forum Discussion

ReneeBay5000's avatar
ReneeBay5000
Copper Contributor
Aug 09, 2022
Solved

copy values from one excel sheet to another by matching multiple columns

Hello,   In building on other recent posts for help (https://techcommunity.microsoft.com/t5/excel/help-with-syntax-functions-to-select-cells-based-on-criteria-of/m-p/3584053#M156384), I now want to...
  • OliverScheurich's avatar
    Aug 10, 2022

    ReneeBay5000 

    = INDEX('[SWL22 Chl-a Data.xlsx]WaterChl ab'! $E$2:$E$257 ,MATCH(1,('[SWL22 Chl-a Data.xlsx]WaterChl ab'! $C$2:$C$257=DM2)*('[SWL22 Chl-a Data.xlsx]WaterChl ab'! $D$2:$D$257=DO2),0))

     

    I assume the data in the other file starts in row 2 in cells DM2 (SLIP1), DN2 (75), DO2 (1) and the formula should be in cell DP2. From cell DP2 the formula can be filled down.

     

    The formula has to be entered with ctrl+shift+enter if you don't work with Office365 or 2021.

     

    =INDEX($E$2:$E$257,MATCH(1,($C$2:$C$257=DM2)*($D$2:$D$257=DO2),0))

    I've tried this corresponding formula within one spreadsheet and it works as expected.

    If there isn't a match the formula returns #NA (#NV in german Excel). If there shouldn't be an error message the whole formula can be wrapped inside IFERROR.

     

    =IFERROR(INDEX($E$2:$E$257,MATCH(1,($C$2:$C$257=DM2)*($D$2:$D$257=DO2),0)),"")

     

Resources