ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Function (https://www.excelbanter.com/excel-programming/274631-excel-function.html)

Shashi Bhosale

Excel Function
 
Hi,

I have a cell with value (Jerry, Tom, Dave, Mark), i want to find first
value (that is Jerry) from the list.
Which function i can use to acheive this.

Thanks in advance,

Shashi



Tom Ogilvy

Excel Function
 
Dim varr as Variant
varr = Array("Jerry","Tom","Dave","Mark")
msgbox varr(lbound(varr))

--
Regards,
Tom Ogilvy


"Shashi Bhosale" wrote in message
...
Hi,

I have a cell with value (Jerry, Tom, Dave, Mark), i want to find first
value (that is Jerry) from the list.
Which function i can use to acheive this.

Thanks in advance,

Shashi





kiat

Excel Function
 
=LEFT(A1,FIND(",",A1)-1)

if (Jerry, Tom, Dave, Mark) is in A1, then above will return Jerry

"Shashi Bhosale" wrote in message
...
Hi,

I have a cell with value (Jerry, Tom, Dave, Mark), i want to find first
value (that is Jerry) from the list.
Which function i can use to acheive this.

Thanks in advance,

Shashi





Alan Beban[_3_]

Excel Function
 
Or slightly more general

Dim x, varr
x = Range("A1").TextToColumns(DataType:=xlDelimited, _
ConsecutiveDelimiter:=True, Space:=True, Comma:=True)
varr = Range("a1", Range("a1").End(xlToRight))
MsgBox varr(LBound(varr), LBound(varr))

You posted in . . .programming, but if you just wanted a worksheet
formula, and only for the first name

=MID(A2,1,FIND(",",A2)-1)

Alan Beban

Tom Ogilvy wrote:
Dim varr as Variant
varr = Array("Jerry","Tom","Dave","Mark")
msgbox varr(lbound(varr))

--
Regards,
Tom Ogilvy


"Shashi Bhosale" wrote in message
...

Hi,

I have a cell with value (Jerry, Tom, Dave, Mark), i want to find first
value (that is Jerry) from the list.
Which function i can use to acheive this.

Thanks in advance,

Shashi








All times are GMT +1. The time now is 11:56 PM.

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