Finding the row a value is in

z0de

Board Regular
Joined
Oct 22, 2010
Messages
75
This seems like it should be easy but I can't find it anywhere.

A user inputs a date in cell b4
There is a table with a row of dates
I want to return what row of the table the date is in.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
That works for the example A1:10 but when I try to use my named table it doesn't work.

Code:
=MATCH(B4,Daily,0)

How the table named Daily is made:
Code:
=OFFSET(Daily_data!$A$1,1,0,COUNTA(Daily_data!$A:$A)-1,51)
 
Upvote 0
If Daily is a named range, the Match function should work fine.

Is the required value actually in the target range ?
 
Upvote 0
It is a named range, I made a new simple named test range (a1:10) and it worked, does anything look wrong how my range Daily is worked out?
 
Upvote 0
sorry, yes it is and I think I've cracked it. It looks like match can't be used for more than one column, if I change Daily to be only 1 column across it works.
 
Last edited:
Upvote 0
Yes, match can only use 1 column
But you don't have to change your named range...
You can use index to use only 1 column of the named range

=MATCH(B4,INDEX(Daily,0,1),0)

The 1 indicates which column of the named range you want to refer to.

It also looks like your named range begins in row 2 because of the offset by 1 row.

So You'll need to Add 1 to the formula

=MATCH(B4,INDEX(Daily,0,1),0)+1


Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,543
Members
452,924
Latest member
JackiG

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