MATCH Function for Array

jgaska

New Member
Joined
Jun 18, 2011
Messages
2
I need to determine the location of a cell within a spreadsheet based on the contents of the cell. My spreadsheet is a calender, divided up into 12 named regions, one for each month. I need to find the row and column of the cell that contains the date (number) specified by some other input cell. For example, if I input "June" into my month input and "12" into my day input, I know how to make it look in my "June" region, but I need to find the location of the 12th within that region. I tried using MATCH, but it would only work for a vector, not an array.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try using the .Find method.

Example code:
Code:
    Dim strMonth As String, iDay As Integer
    
    strMonth = "June"
    iDay = 12
    
    Range(strMonth).Find(iDay, , xlValues, xlWhole, xlByRows, xlNext).Select
 
Upvote 0
Presuming in A1 you have "June" and in A2 the date you're looking for, try:
Code:
=ADDRESS(SUMPRODUCT((INDIRECT($A$1)=$A$2)*ROW(INDIRECT($A$1))),SUMPRODUCT((INDIRECT($A$1)=$A$2)*COLUMN(INDIRECT($A$1))))
 
Upvote 0

Forum statistics

Threads
1,224,508
Messages
6,179,188
Members
452,893
Latest member
denay

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