Index/Match - max value/date result

ksigota

New Member
Joined
Jan 24, 2019
Messages
3
I have tried this formula a NUMBER of different ways and still not able to get the result I'm looking for. I think I've researched it so much that I'm now trying the same things repeatedly and still not getting the answer, so I'll make my first post over...

I'm working with excel 2016, while all my other coworkers are with 2010, so I am a little limited on formulas.

I'm really basically trying to bring up the date the furthest away from today (in column C) based on cells in column A matching cell B - and the information is across sheets, but in the same workbook.

Here's the formula I have now: =IF(ISNA(MATCH(A1,'sheet2'!A:A,0)),"",(INDEX('sheet2'!B:B,(MAX(MATCH(A1,'sheet2'!A:A,0))))))

The IF(ISNA(MATCH(A1,'sheet2'!A:A,0)),"" part makes sure that a1 information is actually in sheet 2.


In sheet1

ABC
HeaderWBSLast Material DueHow many materials
10813.02Formula

<tbody>
</tbody>

In sheet2:

AB
HeaderWBSDATE
10813.0202/22/19
20813.0201/15/19
30799.0102/16/19
40813.0202/03/19
50654.0201/23/19
60813.0201/19/19

<tbody>
</tbody>



I hope all this makes sense. I substituted the actual formula for the tables above to try to give a visual representation. But basically I'm trying to say is if sheet 2 HAS the WBS (sheet 1 a1), then index all the matches in sheet 2 and give me the furthest date from B:B.

Thanks in advance.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
How about
=IF(ISNA(MATCH(A2,Sheet2!A2:A7,0)),"",LARGE(IF(Sheet2!A2:A7=A2,Sheet2!B2:B7),1))
 
Upvote 0
With CSE that appears to work! It must be the K value in the LARGE function (a function I've actually never used), as I don't have experience. I did try 0.

One variation to throw in the mix that I didn't mention, because I wasn't sure it mattered...When there ISN'T a date for column B in sheet2, a general date is reported as 0000-00-00.

What I ended up using because of that was =IF(ISNA(MATCH(A2,Sheet2!A2:A7,0)),"",IFERROR(LARGE(IF(Sheet2!A2:A7=A2,Sheet2!B2:B7),1),"No Date")) with CSE and it appears to work perfectly.

Thank you very much!!!
 
Upvote 0
Glad you got it working & thanks for the feedback.
 
Upvote 0
I found a little more items that needed to be factored into this formula.


In sheet1

ABC
HeaderWBSLast Material DueHow many materials
10813.02Formula

<tbody>
</tbody>

In sheet2:

AB
HeaderWBSDATE
10813.0202/22/19
20813.0201/15/19
30799.0102/16/19
40813.0202/03/19
50654.0201/23/19
60813.0201/19/19

<tbody>
</tbody>

(basically table to is giving lead time dates (B) for the parts ordered against the WBS (A) - each line is a different part/purchase req/purchase order)

We ended with the array function =IF(ISNA(MATCH(A2,Sheet2!A2:A7,0)),"",IFERROR(LARGE(IF(Sheet2!A2:A7=A2,Sheet2!B2:B7),1),"No Date")) that appeared to work great. What I didn't think to factor in was if there was a purchase req that did not yet have a date in sheet 2 assigned to it. The other thing that throws that for a loop is sometimes there are expedite fees that show the 000-00-00 date as well.

ABC
HeaderWBSDATEName
10813.0202/22/19Pin
20813.02000-00-00Block
30799.0102/16/19Sheet
40813.02000-00-00Expedite Fee
50654.0201/23/19Gasket
60813.0201/19/19
Terminal

<tbody>
</tbody>

What I need to figure out is how to show when a part (C) doesn't have a date (B) without showing the parts that have "expedite" in the nomenclature. It is possible to just delete the expedite fees when importing the data to sheet 2.

I'm just starting to work on this part of the problem, but thought I would post up in case someone had a thought or a direction.

TIA
 
Upvote 0

Forum statistics

Threads
1,215,497
Messages
6,125,157
Members
449,208
Latest member
emmac

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