Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Formula assistance

I'm given two columns. Column A is an object description. Column B is how
many of that object I have.

Steel blocks 3
Wood blocks 4
Plastic blocks 5
Aluminum blocks 3
Copper blocks 4
Graphite blocks 3

All the blocks are the same size and I have containers to hold specific
quantites of each.

3
4
5

I'm in need of a formula (preferrably not VBA) to populate column B with
which objects will be in which containers
3 Steel blocks, Aluminum blocks, Graphite blocks
4 Wood blocks, Copper blocks
5 Plastic blocks

Any assistance would be greatly appreciated.

Thanks in advance,

Christmas May
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Formula assistance

If you need the data in Column B (cell data combined with comma delimiter)
using formula then you will have to use multiple IF statements; but again if
you have a big list even that would not be possible. You will have ti use a
VBA solution. Try this UDF (User Defined function). From workbook launch VBE
using Alt+F11. From menu Insert a Module and paste the below function.Close
and get back to workbook and try the below formula.

Syntax:
=VLOOKUP_CONCAT(rngRange,strLookupValue,intColumn, strDelimiter)

rngRange is the Range
strLookupValue is the lookup string or cell reference
inColumn is the column to be concatenated
strDelimiter Optional . Default is space

Examples:
'1. To vlookup 'jacob' and concatenate all entries of 2nd column
=VLOOKUP_CONCAT(A1:B10,"jacob",2)

'2. with lookup value in cell C1
=VLOOKUP_CONCAT(A1:B10,C1,2)

'3. with delimiter as comma
=VLOOKUP_CONCAT(A1:B10,C1,2,",")

Function VLOOKUP_CONCAT(rngRange As Range, _
strLookupValue As String, intColumn As Integer, _
Optional strDelimiter As String = " ")
Dim lngRow As Long
For lngRow = 1 To rngRange.Rows.Count
If StrComp(CStr(rngRange(lngRow, 1)), _
strLookupValue, vbTextCompare) = 0 Then _
VLOOKUP_CONCAT = VLOOKUP_CONCAT & strDelimiter & _
rngRange(lngRow, intColumn)
Next
VLOOKUP_CONCAT = Mid(VLOOKUP_CONCAT, Len(strDelimiter) + 1)
End Function


If this post helps click Yes
---------------
Jacob Skaria


"Christmas May" wrote:

I'm given two columns. Column A is an object description. Column B is how
many of that object I have.

Steel blocks 3
Wood blocks 4
Plastic blocks 5
Aluminum blocks 3
Copper blocks 4
Graphite blocks 3

All the blocks are the same size and I have containers to hold specific
quantites of each.

3
4
5

I'm in need of a formula (preferrably not VBA) to populate column B with
which objects will be in which containers
3 Steel blocks, Aluminum blocks, Graphite blocks
4 Wood blocks, Copper blocks
5 Plastic blocks

Any assistance would be greatly appreciated.

Thanks in advance,

Christmas May

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
Formula Assistance tommo Excel Discussion (Misc queries) 3 January 14th 09 04:01 PM
*Assistance with formula* Gail Richner Excel Programming 3 April 2nd 08 01:32 PM
Need assistance with a formula - If then??? Bookmdano Excel Worksheet Functions 3 October 3rd 07 07:52 PM
Assistance with Formula [email protected] Excel Worksheet Functions 12 February 9th 07 08:52 PM
Formula Assistance DougS Excel Worksheet Functions 1 March 29th 05 11:35 PM


All times are GMT +1. The time now is 07:00 PM.

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"