Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default MATCH() Function and Blanks

I have a column of values and am trying to identify where values appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in this
application.

So can I find values in a list even if the value is a blank??
--
Gary''s Student - gsnu2007xx
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default MATCH() Function and Blanks

Hi,

Try this

SUMPRODUCT((A1:A5=B1)*(ROW(1:5)))

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Gary''s Student" wrote in message
...
I have a column of values and am trying to identify where values appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in this
application.

So can I find values in a list even if the value is a blank??
--
Gary''s Student - gsnu2007xx


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default MATCH() Function and Blanks

Thanks!
--
Gary''s Student - gsnu200805


"Ashish Mathur" wrote:

Hi,

Try this

SUMPRODUCT((A1:A5=B1)*(ROW(1:5)))

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Gary''s Student" wrote in message
...
I have a column of values and am trying to identify where values appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in this
application.

So can I find values in a list even if the value is a blank??
--
Gary''s Student - gsnu2007xx


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default MATCH() Function and Blanks

You are welcome

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Gary''s Student" wrote in message
...
Thanks!
--
Gary''s Student - gsnu200805


"Ashish Mathur" wrote:

Hi,

Try this

SUMPRODUCT((A1:A5=B1)*(ROW(1:5)))

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Gary''s Student" wrote in
message
...
I have a column of values and am trying to identify where values appear
in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in
this
application.

So can I find values in a list even if the value is a blank??
--
Gary''s Student - gsnu2007xx


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default MATCH() Function and Blanks

No offense but that formula is not generic and it will return
an incorrect value if for instance the list is in A6:A10
Not only that but it will always count from row 1!


--


Regards,


Peo Sjoblom

"Ashish Mathur" wrote in message
...
You are welcome

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Gary''s Student" wrote in
message ...
Thanks!
--
Gary''s Student - gsnu200805


"Ashish Mathur" wrote:

Hi,

Try this

SUMPRODUCT((A1:A5=B1)*(ROW(1:5)))

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Gary''s Student" wrote in
message
...
I have a column of values and am trying to identify where values
appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in
this
application.

So can I find values in a list even if the value is a blank??
--
Gary''s Student - gsnu2007xx





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default MATCH() Function and Blanks

On Sat, 20 Sep 2008 09:51:45 -0700, "Peo Sjoblom"
wrote:

No offense but that formula is not generic and it will return
an incorrect value if for instance the list is in A6:A10
Not only that but it will always count from row 1!



I think it will work if you e.g. change A1:A5 to A6:A10 as long as you
do NOT change the 1:5 in the ROW().

Lars-Åke
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default MATCH() Function and Blanks

On Sat, 20 Sep 2008 03:57:00 -0700, Gary''s Student
wrote:

I have a column of values and am trying to identify where values appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in this
application.

So can I find values in a list even if the value is a blank??


Try the following formula.

=MATCH("x"&B1,"x"&A1:A5,0)

Note that this is an array formula that has to be entered with
CTRL+SHIFT+ENTER rather than just ENTER.

Hope this helps / Lars-Åke
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default MATCH() Function and Blanks

Thanks!
Also thank you for your help several weeks ago.
--
Gary''s Student - gsnu200805


"Lars-Ã…ke Aspelin" wrote:

On Sat, 20 Sep 2008 03:57:00 -0700, Gary''s Student
wrote:

I have a column of values and am trying to identify where values appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in this
application.

So can I find values in a list even if the value is a blank??


Try the following formula.

=MATCH("x"&B1,"x"&A1:A5,0)

Note that this is an array formula that has to be entered with
CTRL+SHIFT+ENTER rather than just ENTER.

Hope this helps / Lars-Ã…ke

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default MATCH() Function and Blanks

=MATCH(TRUE,INDEX(A1:A5=B1,),)


"Gary''s Student" wrote:

I have a column of values and am trying to identify where values appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in this
application.

So can I find values in a list even if the value is a blank??
--
Gary''s Student - gsnu2007xx

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default MATCH() Function and Blanks

Thanks....very nice solution
--
Gary''s Student - gsnu200805


"Teethless mama" wrote:

=MATCH(TRUE,INDEX(A1:A5=B1,),)


"Gary''s Student" wrote:

I have a column of values and am trying to identify where values appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in this
application.

So can I find values in a list even if the value is a blank??
--
Gary''s Student - gsnu2007xx



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default MATCH() Function and Blanks

You're Welcome!



"Gary''s Student" wrote:

Thanks....very nice solution
--
Gary''s Student - gsnu200805


"Teethless mama" wrote:

=MATCH(TRUE,INDEX(A1:A5=B1,),)


"Gary''s Student" wrote:

I have a column of values and am trying to identify where values appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in this
application.

So can I find values in a list even if the value is a blank??
--
Gary''s Student - gsnu2007xx

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default MATCH() Function and Blanks

one more option, array entered

=MATCH(C2&"",A1:A4&"",0)


"Gary''s Student" wrote:

I have a column of values and am trying to identify where values appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in this
application.

So can I find values in a list even if the value is a blank??
--
Gary''s Student - gsnu2007xx

  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default MATCH() Function and Blanks

Thanks!
--
Gary''s Student - gsnu200805


"JMB" wrote:

one more option, array entered

=MATCH(C2&"",A1:A4&"",0)


"Gary''s Student" wrote:

I have a column of values and am trying to identify where values appear in
the column. For example, in A1 thru A5:

cow
mouse

pig
horse


Note A3 is blank. If I put "pig" in B1 then the formula

=MATCH(B1,A1:A5,0)

correctly returns 4

If I leave B1 blank, the formula returns #N/A rather than 3.
I need the result to be 3.

I can make a UDF to give the correct result, but I can't use VBA in this
application.

So can I find values in a list even if the value is a blank??
--
Gary''s Student - gsnu2007xx

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
Why are blanks being ignored by my MIN function? catherine bodine Excel Worksheet Functions 7 November 30th 07 09:30 PM
growth function with blanks Knox Excel Worksheet Functions 0 October 25th 07 06:08 PM
index match array function-returning only first match, need last. Julie Olsen Excel Worksheet Functions 3 December 29th 06 12:50 AM
Paste Special Skip Blanks not skipping blanks, but overwriting... gsrosin Excel Discussion (Misc queries) 0 February 22nd 05 03:33 AM
Excluding 0s and blanks from a LINEST function Disco Excel Worksheet Functions 4 February 4th 05 04:54 AM


All times are GMT +1. The time now is 02:49 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"