0

Column C calculates the earliest date from column A and B.

What would be the shortest function to display Row A1 or A2 in Column D as per the value of Column C?

Overhaul 1  Overhaul 2   Earliest due   Reason
01-Dec-2016 06-Aug-2017  01-Dec-2016    Overhaul 1
08-Oct-2023 01-Sep-2019  01-Sep-2019    Overhaul 2
26-Apr-2015 16-Nov-2025  26-Apr-2015    Overhaul 1
03-Mar-2051 12-Dec-2027  12-Dec-2027    Overhaul 2
3
  • 1
    Hello! To avoid us telling you things you've already attempted, please share your research with us. What have you tried already? Where exactly are you getting stuck? Dec 16, 2014 at 15:37
  • 1
    Assuming you are just using an IF test to get column C, use the same IF test but select the heading cell instead of the data cell. Anchor the cell references with $ to copy down the page.
    – fixer1234
    Dec 16, 2014 at 16:57
  • if(a2<b2,\,_) Where \ is the named range $A$1 and _ is the named range $B$1. Could probably go a bit shorter with more named ranges but I'm not sure what 1 character names are valid
    – gtwebb
    Dec 17, 2014 at 0:07

1 Answer 1

0

Earliest due date (column C, starting at C2) can be calculated with =MIN(A2:B2), then copy this formula down across the column.

You can then get the matching headers into column D, starting at D2, with =IF(A2<=B2,$A$1,$B$1). Then, again, copy this formula down the entire column.

In case both overhaul dates are identical, this solution will always choose Overhaul 1.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .