my $valA = $sheet->{Cells}[$row][0]->{Val}; if (exists $colD{$valA}) { ...