Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
johanvdv
 
Posts: n/a
Default Lookup function, need help

Hello,

Example:

A B C D
1 Mark David Elise Ted
2 X P X X


what I want:
A formula to give me the names of the people(row 1) with a "X" in row 2

Can't seem to figure it out, tried Lookup functions...

Thanks a lot,
Johan

  #2   Report Post  
bj
 
Posts: n/a
Default

do not know what you really want but try
=if(A2="X",A1&" ","")+if(B2="X",B1&" ","")+if(C2="X",C1&"
","")+if(D2="X",D1&" ","")+

"johanvdv" wrote:

Hello,

Example:

A B C D
1 Mark David Elise Ted
2 X P X X


what I want:
A formula to give me the names of the people(row 1) with a "X" in row 2

Can't seem to figure it out, tried Lookup functions...

Thanks a lot,
Johan


  #3   Report Post  
johanvdv
 
Posts: n/a
Default

it works if I put a CONCATENATE around it but:

- I can only concatenate 5 strings
- I have A LOT of columns, it would become a VERY large formula

Is't there a shorter, better way ?

  #4   Report Post  
Stefi
 
Posts: n/a
Default

Hi Johan,

You don't mention in what form you need the names (in a string, in a column,
etc.) but I would transpose my data into another sheet, then you can use a
simple autofilter to see rows with X in column B.

Post if this solution meets your needs and if you want additional help on
transposing and filtering!

Regards,
Stefi

€žjohanvdv€ť ezt Ă*rta:

it works if I put a CONCATENATE around it but:

- I can only concatenate 5 strings
- I have A LOT of columns, it would become a VERY large formula

Is't there a shorter, better way ?


  #5   Report Post  
bj
 
Posts: n/a
Default

another way to do it
use a helper row
(3?)
in A3 enter
=if(A2="X",A1&" ","")
copy across your data
somewhere else
=Concatinate(3:3)


"johanvdv" wrote:

it works if I put a CONCATENATE around it but:

- I can only concatenate 5 strings
- I have A LOT of columns, it would become a VERY large formula

Is't there a shorter, better way ?




  #6   Report Post  
Jim May
 
Posts: n/a
Default

How many columns do you have?
It will probably require a VBA solution;
Jim


"johanvdv" wrote in message
oups.com...
it works if I put a CONCATENATE around it but:

- I can only concatenate 5 strings
- I have A LOT of columns, it would become a VERY large formula

Is't there a shorter, better way ?



  #7   Report Post  
Harlan Grove
 
Posts: n/a
Default

bj wrote...
do not know what you really want but try
=if(A2="X",A1&" ","")+if(B2="X",B1&" ","")
+if(C2="X",C1&" ","")+if(D2="X",D1&" ","")+

....

Always best to test. Using + as operator with guaranteed nonnumeric
string operands will always produce #VALUE! errors. Did you mean to put
& between all the IF calls?

  #8   Report Post  
Krishnakumar
 
Posts: n/a
Default


Hi,

Try,

In A3 and copied down,

=IF(ROW(A1)-ROW($A$1)+1COUNTIF($A$2:$D$2,"x"),"",INDEX($A$1:$ D$1,SMALL(IF($A$2:$D$2="x",COLUMN($A$2:$D$2)),ROW( A1)-ROW($A$1)+1)))

Or if you want the results in one cell,

=SUBSTITUTE(aCONCAT(IF(A2:D2="x",A1:D1),","),",Fal se","")

Confirm with Ctrl+Shift+Enter.

ACONCAT is a UDF.


Code:
--------------------
Function aconcat(a As Variant, Optional sep As String = "") As String
' Harlan Grove, Mar 2002
Dim y As Variant

If TypeOf a Is Range Then
For Each y In a.Cells
aconcat = aconcat & y.Value & sep
Next y
ElseIf IsArray(a) Then
For Each y In a
aconcat = aconcat & y & sep
Next y
Else
aconcat = aconcat & a & sep
End If

aconcat = Left(aconcat, Len(aconcat) - Len(sep))
End Function
--------------------


HTH


--
Krishnakumar


------------------------------------------------------------------------
Krishnakumar's Profile: http://www.excelforum.com/member.php...o&userid=20138
View this thread: http://www.excelforum.com/showthread...hreadid=465642

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookup Function help marlea Excel Discussion (Misc queries) 2 August 23rd 05 07:30 PM
Lookup Function Problems FFW Excel Worksheet Functions 2 August 21st 05 04:22 PM
Complicated lookup function chrisrowe_cr Excel Worksheet Functions 4 July 19th 05 05:52 PM
lookup function 1 Colboyfx Excel Worksheet Functions 4 July 15th 05 09:15 AM
How do I use 3 cells to create the string for a lookup function? Bencomo Excel Worksheet Functions 1 May 15th 05 07:17 AM


All times are GMT +1. The time now is 06:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"