From: Peter Gasparik on
Hi I have a problem.
I have two columns in different spreadsheets:
A B D
27238-2807 27736-1321 D1
27736-1321 27238-2807 D2
27736-1321 27736-1321 D3
27736-1321 27736-1321 D8
27251-3761 27238-2807 D1

I would like to write a formula or VBA the if A = B then pick up the value
in column D.
Could you please help?

Many thanks,

Peter.
From: Jacob Skaria on
Try the below in any cell in row1 and copy down as required...

=IF(A1=B1,D1,"")

--
Jacob (MVP - Excel)


"Peter Gasparik" wrote:

> Hi I have a problem.
> I have two columns in different spreadsheets:
> A B D
> 27238-2807 27736-1321 D1
> 27736-1321 27238-2807 D2
> 27736-1321 27736-1321 D3
> 27736-1321 27736-1321 D8
> 27251-3761 27238-2807 D1
>
> I would like to write a formula or VBA the if A = B then pick up the value
> in column D.
> Could you please help?
>
> Many thanks,
>
> Peter.
From: Mike H on
Hi,

Try this and drag down

=IF(Sheet1!A1=Sheet1!B1,Sheet1!D1,"")
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Peter Gasparik" wrote:

> Hi I have a problem.
> I have two columns in different spreadsheets:
> A B D
> 27238-2807 27736-1321 D1
> 27736-1321 27238-2807 D2
> 27736-1321 27736-1321 D3
> 27736-1321 27736-1321 D8
> 27251-3761 27238-2807 D1
>
> I would like to write a formula or VBA the if A = B then pick up the value
> in column D.
> Could you please help?
>
> Many thanks,
>
> Peter.
From: Jacob Skaria on
Oops...Didnt notice "different spreadsheets"..Could you please clarify?

--Do you mean ColA and ColB in different "spreadsheets" or both Cols in one
different spreadsheet?

--If both columns are in the same spreadsheet; then try what Mike has posted..

--Do you mean a row to row match or check whether each cell in Col A of
SheetX exist in Col B of SheetY...and if so return the corresponding value of
Cell A1 from SheetX Col D

--
Jacob (MVP - Excel)


"Jacob Skaria" wrote:

> Try the below in any cell in row1 and copy down as required...
>
> =IF(A1=B1,D1,"")
>
> --
> Jacob (MVP - Excel)
>
>
> "Peter Gasparik" wrote:
>
> > Hi I have a problem.
> > I have two columns in different spreadsheets:
> > A B D
> > 27238-2807 27736-1321 D1
> > 27736-1321 27238-2807 D2
> > 27736-1321 27736-1321 D3
> > 27736-1321 27736-1321 D8
> > 27251-3761 27238-2807 D1
> >
> > I would like to write a formula or VBA the if A = B then pick up the value
> > in column D.
> > Could you please help?
> >
> > Many thanks,
> >
> > Peter.