Match blank cell

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,832
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
In column A, I have 5 rows, a,b,c,d,e. In cell C1 have the value c.

In cells D1, I have this formula:

Code:
=Match(C1,A1:A5,0)

which returns 3 as expected.

If instead column A contained a, "",c,d,e and cell C1 contains a blank cell, the match function returns N/A.

How can I change to return the value of 2?

Thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Book1
ABCD
1a2
2
3c
4d
5e
Sheet2
Cell Formulas
RangeFormula
D1D1=IF(ISBLANK(C1),AGGREGATE(15,6,ROW(A1:A5)/(A1:A5=""),1),MATCH(C1,A1:A5,0))
 
Upvote 0
Solution
Hi,
try this in D1

=IFERROR(MATCH(C1,A1:A5,0),2)

Hopefully this works for you.
 
Upvote 0

Forum statistics

Threads
1,214,870
Messages
6,122,021
Members
449,060
Latest member
LinusJE

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