Help with INDEX, MATCH and MAX formula - or alternative needed.

glynnseal

New Member
Joined
Jun 4, 2014
Messages
5
Hi all,

I need some help with Excel.

Ive got two worksheets in a workbook.

Sheet 1 contains a table with the following columns;
Column A : This column contains a list of unique IDs. These are 'sites'
Column B to F : Where I need some formulae.

Sheet 2 contains a table with the following columns;
Column A : This column contains a list of the unique IDs appearing in Sheet 1, Column A, BUT it can contain multiple instances of this ID (ie; the site can appear

multiple times).
Column B : This column contains a month value (the date in which the site was attended) Note that a site can have been attended in more than one month, hence the

site appearing multiple times in sheet 2.
Column T to X : These columns are columns that relate to specific tasks carried out at the site. So column T could be headed 'gardening'. The values in these columns are yes or no values.


So here is my conundrum;

I need to put a formula in Sheet 1, Column B to Column F (which correlate to the Sheet 2, Column T to X headings) where the result is;

The last month that a task was (yes, not no) carried out at a site.
So if the site appears in Sheet 2, Column A 7 times, I want the last month (Column B) where it was a 'yes' value in the relevant task columns.

Hope this makes sense.

Sample Structure -
322849d1401879713-please-help-to-stop-my-brain-from-hurting-p-capture.jpg

Note that this is cross-posted; http://www.excelforum.com/excel-for...mula-or-alternative-solution.html#post3720406

So, if I want to find out the last month that I last did gardening at Site 2. The formula in Sheet 1, Column B would return [Feb-14].

I've been messing about with INDEX, MATCH and MAX but to be honest I'm getting my knickers in a twist :)

Many thanks,
Glynn
 
Last edited:
Many thanks Andrew,

Ive tried it but I'm getting #VALUE, so I am guessing its to do with how my values are formatted. Maybe I should have said that my Month column is actually derived from a formula referring to another cell on another sheet.

Is there something missing at the end of your INDEX formula?
 
Upvote 0
What's the formula in the Month column? It needs to return a serial date.

Nothing is missing from the end of INDEX. It is returning an array.
 
Upvote 0
Ah okay.
The formula in the Month column is =IF('Security Contracted'!E8="","",'Security Contracted'!E8). This basically looks at another Month value in another sheet (which is formatted as mmm-yy), and if its blank, blanks it - so I don't get 0's.
 
Last edited:
Upvote 0
Oh I see. The formula is failing because it's trying to multiply by "". Can you change the formula to return 0 instead of "" and format the cell as mmm-yy;; to suppress the zeroes?
 
Upvote 0
Andrew, thanks so much for your help with this.
Its pretty much there now :). Only thing I need to resolve with the last suggestion is that cells that are blank now calculate as Jan-00 rather than being blank. I guess I can conditional format that out, as its not a date that i need to be worried about.

You are a legend, many thanks Andrew.
 
Upvote 0
Ah, didn't spot those... but now that's worked perfectly. Brilliant, thanks Andrew!!
*buys Andrew his favourite tipple*
 
Upvote 0

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