# Match blank cell

#### tiredofit

##### Well-known Member
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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

#### lrobbo314

##### Well-known Member
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))

#### tiredofit

##### Well-known Member
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))
Thanks

#### Chowmann78

##### New Member
Hi,
try this in D1

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

Hopefully this works for you.

#### tiredofit

##### Well-known Member
Hi,
try this in D1

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

Hopefully this works for you.
No because it's not always going to be 2!

Replies
6
Views
112
Replies
1
Views
30
Replies
8
Views
98
Replies
6
Views
128
Replies
2
Views
45

1,130,424
Messages
5,642,037
Members
417,251
Latest member
Dordrecht

### 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.

### Which adblocker are you using?

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

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