Match blank cell

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,411
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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
3,134
Office Version
  1. 365
Platform
  1. Windows
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))
 
Solution

Chowmann78

New Member
Joined
Dec 7, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi,
try this in D1

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

Hopefully this works for you.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,300
Messages
5,635,398
Members
416,856
Latest member
silentir

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
Top