Macro that analyses data from 3 columns and puts result in 4th

A

andrei

I have column A with 100 cells . All cells contain numbers from 1 to 100 .
Every cell has a different number as content
I have column B with 100 cells containing numbers , too .
Tthis time the content from each cell is not unique . Number 3 can be in
cell B6 , B7 etc (example)

I put a list with numbers in column C . All numbers in column C are to be
found in A column .

Example :

A1 - 1 B1- 1 C1- 7
A2 - 2 B2- 1 C2- 3
A3 - 3 B3- 2 C3- 1
A4- 4 B4- 2 C4- 5
A5 - 5 B5- 3
A6 - 6 B6- 4
A7 - 7 B7- 4
A8 - 8 B8- 4

Tha macro should do this . Reads C1 . Finds the same content in A7 . So it
puts in D1 the content from B7 ( number 4 )
 
M

Mike H

Hi,

A macro isn't necessary for this. Put the formula below in D1 and drag down

IF(COUNTIF($A$1:$A$8,C1)=0,"",VLOOKUP(C1,$A$1:$B$8,2,FALSE))

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top