# 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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

#### 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
86
Replies
8
Views
77
Replies
6
Views
110
Replies
3
Views
18
Replies
0
Views
42

1,127,699
Messages
5,626,382
Members
416,176
Latest member
Dyl

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