Cod88
Cod88

Reputation: 1

To display multiple columns in excel using functions

I want to display two different columns in excel using functions.

Eg, I have three columns in excel, one column for Alphabets, one column for Numbers and the last one with value XYZ or ABC. (Sorry not able to add image as I am not allowed to add images yet )

A 1 Xyz


B 2 XYZ


C 3 ABC


D 4 ABC


E 5 XYZ

I want to check the value in third column = XYZ and print the other two corresponding cells that matches the result.

The results I want to display is if the row matches XYZ then A and 1, B and 2, E and 5 must be displayed,

I tried : =If(C3="XYZ",A1:B1,"") Also tried =Index(A1:B6,Match(XYZ,C:C,0))

But had not luck. I am very sure that I am not able to get the values of two cells using one function.

SO I tried this function: =If(C3="XYZ",A1,"") and =If(C3="XYZ",B1,"") and was able to print results in cells seperately.

Please help!!

Upvotes: 0

Views: 112

Answers (1)

Steven Martin
Steven Martin

Reputation: 3290

Use

 =If(C3="XYZ",CONCATENATE(A1," ",B1),"") 

or if you want the values joined use

 =If(C3="XYZ",CONCATENATE(A1,B1),"") 

Upvotes: 1

Related Questions