Retriving multiple items

gwizrus

New Member
Joined
Sep 26, 2006
Messages
12
I have a ss with server listings and drive zones associated with them. I need to find all the drives shared for a given server and drive zone.

The input values would be Server and drive zone. For instance, if I search for plums and 4,1. Output for Shared With would be apples, carrots.
tape report.xls
ABCDEFGHIJ
1DriveZone
2Server4,04,14,25,05,1
3applesxxServerDriveZoneSharedWith
4plumsxapples4,1plums,carrots
5carrotsxx
Sheet1


Thanks
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
If you download and install the morefunc.xll add-in...

J4:

=SUBSTITUTE(TRIM(IF(INDEX($B$3:$F$5,MATCH(H4,$A$3:$A$5,0),MATCH(I4,$B$2:$F$2,0))="x",MCONCAT(IF(SETV(INDEX($B$3:$F$5,0,MATCH(I4,$B$2:$F$2,0)))="x",IF($A$3:$A$5=H4,"",$A$3:$A$5),"")," "),""))," ",",")

which you need to confirm with control+shift+enter, not just with enter.
 
Upvote 0
Aladin,

That was impressive!!! Now, being an excel newbie with functions, I need to figure out if I can understand it.

Thanks again.
 
Upvote 0
Aladin,

That was impressive!!! Now, being an excel newbie with functions, I need to figure out if I can understand it.

Thanks again.

You are welcome. Remove the SETV call though...

=SUBSTITUTE(TRIM(IF(INDEX($B$3:$F$5,MATCH(H4,$A$3:$A$5,0),MATCH(I4,$B$2:$F$2,0))="x",MCONCAT(IF(INDEX($B$3:$F$5,0,MATCH(I4,$B$2:$F$2,0))="x",IF($A$3:$A$5=H4,"",$A$3:$A$5),"")," "),""))," ",",")
 
Upvote 0
Aladin,

Thanks, I actually figured out I did not need it since a getv was never referenced. Otherwise it served no other purpose.

I have two questions. What causes excel to loop through the values. I'm use to doing Do..While or something to that nature to cause a loop in code. Second looking at this part of the code....

IF($A$3:$A$5=H4,"",$A$3:$A$5)

How does excel know to correlate the correct A cell with the row of x's that were found. My understanding is that by using a 0 for the row number in the index function causes an array containing only the values for that column? is this correct?

Thanks,
 
Upvote 0
...
I have two questions. What causes excel to loop through the values. I'm use to doing Do..While or something to that nature to cause a loop in code. Second looking at this part of the code....

IF($A$3:$A$5=H4,"",$A$3:$A$5)

How does excel know to correlate the correct A cell with the row of x's that were found. My understanding is that by using a 0 for the row number in the index function causes an array containing only the values for that column? is this correct?
...

Let's look at the main IF in MCONCAT...

Code:
IF(INDEX($B$3:$F$5,0,MATCH(I4,$B$2:$F$2,0))="x",
      IF($A$3:$A$5=H4,"",$A$3:$A$5),
      "")

The Index epression in the Condition-part of the main (outer) IF picks out all cells corresponding to the drive zone of interest and each such cell is tested for being equal to "x". For every TRUE evaluation, the inner IF, that is,

Code:
IF($A$3:$A$5=H4,
    "",
    $A$3:$A$5)

otherwise (for a FALSE evaluation) we get a blank (i.e., "").

The Condition-part of the outer IF yields

{TRUE;TRUE;TRUE}

The Condition-part of the inner IF which is:

$A$3:$A$5=H4

corresponding to the foregoing set of TRUE's yields:

{TRUE;FALSE;FALSE}

meaning

A3=H4 (apples=apples)
A4=H4 (plums=apples)
A5=H4 (carrots=apples)

with TRUE return "", otherwise (with FALSE) return corresponding A-cell. Thus, the Inner If yields:

{"";"plums";"carrots"}

a result passed to MCONCAT to process.

Hope this answers your question.
 
Upvote 0

Forum statistics

Threads
1,222,122
Messages
6,164,084
Members
451,872
Latest member
TimothyLynn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top