ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro that analyses data from 3 columns and puts result in 4th (https://www.excelbanter.com/excel-programming/434313-macro-analyses-data-3-columns-puts-result-4th.html)

Andrei

Macro that analyses data from 3 columns and puts result in 4th
 
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 )

Mike H

Macro that analyses data from 3 columns and puts result in 4th
 
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

"andrei" wrote:

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 )


Andrei

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



All times are GMT +1. The time now is 12:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com