Match function result in #N/A

ezfan

New Member
Joined
Nov 29, 2011
Messages
8
Dear Exceler,

I have a problem that appreciate if anyone can help?

I have tried doing a function to extract unique list and remove duplicates. It results in #N/A.

=INDEX(tt,MATCH(0,COUNTIF(tt,"<"&tt)-SUM(COUNTIF(tt,C$1:C1)),0)) where tt is:
=$A$4:INDEX($A$2:$A$20,MATCH($A$1,$B$2:$B$20)) -->

I check the error in excel for the first formula and tried pressing F9 for each of the function and they all work.
For the first formula, when I only leave the COUNTIF and SUM function in the cell, it showed value.
When I leave the whole MATCH function, it leaves a #N/A. However, when I checked in the edit formula bar by pressing F9, it result in the value as expected.
I dont understand why it would results in #N/A in excel but F9 showed it has no problem.

Anyone can help? Thanks.

Regards,
ezfan
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Dear Exceler,

I have a problem that appreciate if anyone can help?

I have tried doing a function to extract unique list and remove duplicates. It results in #N/A.

=INDEX(tt,MATCH(0,COUNTIF(tt,"<"&tt)-SUM(COUNTIF(tt,C$1:C1)),0)) where tt is:
=$A$4:INDEX($A$2:$A$20,MATCH($A$1,$B$2:$B$20,0)) -->

I check the error in excel for the first formula and tried pressing F9 for each of the function and they all work.
For the first formula, when I only leave the COUNTIF and SUM function in the cell, it showed value.
When I leave the whole MATCH function, it leaves a #N/A. However, when I checked in the edit formula bar by pressing F9, it result in the value as expected.
I dont understand why it would results in #N/A in excel but F9 showed it has no problem.

Anyone can help? Thanks.

Regards,
ezfan
Does it make a difference if you use a match_type of 0 in your range expression:

=$A$4:INDEX($A$2:$A$20,MATCH($A$1,$B$2:$B$20,0))

If that doesn't work then post some sample data and tell us what result you expect.
 
Upvote 0
Dear Biff,

Thanks for the reply.

I have tried the change and no change in the result.
Here's the screenshot of the data:
Col A ColB ColC
Product Code Count Product
SM301 1 #N/A
SM302 2 #N/A
SM303 3 #N/A
SM304 4 #N/A
SM305 5 #N/A
#N/A
#N/A

Please note that my Col A actually are formula that pull data from another sheet and hence the blank below the SM305 are actually formula. Therefore, did not use exact formula from other Magic Trick to search for REPT('z") but used COlB to find the last row and I defined tt for the colA range.

Please help.

Best regards,
ezfan
 
Upvote 0
Dear Biff,

Thanks for the reply.

I have tried the change and no change in the result.
Here's the screenshot of the data:
Col A ColB ColC
Product Code Count Product
SM301 1 #N/A
SM302 2 #N/A
SM303 3 #N/A
SM304 4 #N/A
SM305 5 #N/A
#N/A
#N/A

Please note that my Col A actually are formula that pull data from another sheet and hence the blank below the SM305 are actually formula. Therefore, did not use exact formula from other Magic Trick to search for REPT('z") but used COlB to find the last row and I defined tt for the colA range.

Please help.

Best regards,
ezfan
Ok, I'm not sure what you're trying to do with this?

Do you want to extract the unique products?
 
Upvote 0
Dear Biff,

I actually tried following magic trick worksheet formula and doing the same in y Excel 2007 version (also tried the same in office 2010 version. However, in both cases, when the formula is used in my workbook, they in F9 can return with a value, however, excel will at the end result in N/A.

I will try again put my scenario as below: My objective is to return the 3 products as unique value and only have 3 enties to the product column.

Sheet:
Product Code Product
TIN1205601 #N/A
TIN1205601 #N/A
TIN1205601 #N/A
TIN1205602 #N/A
TIN1205602 #N/A
TIN1205602 #N/A
TIN1205602 #N/A
TIN1205603 #N/A
TIN1205603 #N/A
TIN1205603 #N/A
#N/A
#N/A
#N/A
#N/A
#N/A
#N/A
#N/A

The formula in the #N/A column now using the formula:
=INDEX(tt,MATCH(0,COUNTIF(tt,"<"&tt)-SUM(COUNTIF(tt,C$1:C1)),0))

tt now = =Sheet2!$A$2:INDEX(Sheet2!$A$2:$A$18,MATCH(REPT("z",255),Sheet2!$A$2:$A$18))

Will there be case that some formula only works in a particular workbook?

Thanks.
Regards,
ezfan
 
Upvote 0
Dear Biff,

I actually tried following magic trick worksheet formula and doing the same in y Excel 2007 version (also tried the same in office 2010 version. However, in both cases, when the formula is used in my workbook, they in F9 can return with a value, however, excel will at the end result in N/A.

I will try again put my scenario as below: My objective is to return the 3 products as unique value and only have 3 enties to the product column.

Sheet:
Product Code Product
TIN1205601 #N/A
TIN1205601 #N/A
TIN1205601 #N/A
TIN1205602 #N/A
TIN1205602 #N/A
TIN1205602 #N/A
TIN1205602 #N/A
TIN1205603 #N/A
TIN1205603 #N/A
TIN1205603 #N/A
#N/A
#N/A
#N/A
#N/A
#N/A
#N/A
#N/A

The formula in the #N/A column now using the formula:
=INDEX(tt,MATCH(0,COUNTIF(tt,"<"&tt)-SUM(COUNTIF(tt,C$1:C1)),0))

tt now = =Sheet2!$A$2:INDEX(Sheet2!$A$2:$A$18,MATCH(REPT("z",255),Sheet2!$A$2:$A$18))

Will there be case that some formula only works in a particular workbook?

Thanks.
Regards,
ezfan
Ok, try this...

I put everything on one sheet to make the exhibit easy to see/understand.

Book1
ABC
2TIN1205601_TIN1205601
3TIN1205601_TIN1205602
4TIN1205601_TIN1205603
5TIN1205602__
6TIN1205602__
7TIN1205602__
8TIN1205602__
9TIN1205603__
10TIN1205603__
11TIN1205603__
Sheet1

Redefine the named range tt as:

=Sheet1!$A$2:INDEX(Sheet1!$A$2:$A$18,MATCH("zzzzz",Sheet1!$A$2:$A$18))

Enter this formula in C2:

=A2

Enter this array formula** in C3 and copy down until you get blanks:

=LOOKUP("zzzzz",CHOOSE({1,2},"",INDEX(tt,MATCH(0,COUNTIF(C$2:C2,tt),0))))

If you're using Excel 2007 or later then we can reduce that array formula** to:

=IFERROR(INDEX(tt,MATCH(0,COUNTIF(C$2:C2,tt),0)),"")

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0
Hi Biff,

Thanks a lot for your help.

It works now! Great Help! Really appreciated!\

Regards,
ezfan
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,490
Members
448,967
Latest member
visheshkotha

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