# max date basis required next column.

##### New Member
dear All,

We have a huge data in excel file , we need to find max date in different columns and on the basis of max date we also required next column code.

Please suggest a formula or vba code.

 Date Code Date Code Date Code Max Date Code on the basis of max date 01-Nov-16 461 05-Nov-16 1124 30-Nov-16 1008 30-Nov-16 1008 30-Nov-16 1135 07-Dec-16 1091 24-Dec-16 1089 24-Dec-16 1089 06-Dec-16 1124 06-Dec-16 1126 10-Oct-16 979 06-Dec-16 Error 15-Nov-16 1049 01-Nov-16 1048 14-Dec-16 1060 14-Dec-16 1060 17-Oct-16 1061 15-Sep-16 1062 15-Sep-16 1085 17-Oct-16 1061 01-Sep-16 1173 08-May-16 1172 04-Jul-16 1170 01-Sep-16 1173 09-Aug-16 1171 08-Mar-16 1203 01-Nov-16 1207 01-Nov-16 1207

<tbody>
</tbody>

### Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

#### AliGW

##### Banned
Why does line three resolve to an error and not 1126?

#### AliGW

##### Banned
Try this:

Excel 2016 (Windows) 32 bit
ABCDEFGH
1DateCodeDateCodeDateCodeMax DateCode on the basis of max date
201-Nov-1646105-Nov-16112430-Nov-16100830-Nov-161008
330-Nov-16113507-Dec-16109124-Dec-16108924-Dec-161089
406-Dec-16112406-Dec-16112610-Oct-1697906-Dec-161126
515-Nov-16104901-Nov-16104814-Dec-16106014-Dec-161060
617-Oct-16106115-Sep-16106215-Sep-16108517-Oct-161061
701-Sep-16117308-May-16117204-Jul-16117001-Sep-161173
809-Aug-16117108-Mar-16120301-Nov-16120701-Nov-161207
Sheet1
Cell Formulas
RangeFormula
G2=MAX(\$A2:\$F2)
H2=LOOKUP(2,1/(\$A2:\$F2=G2),\$B2:\$G2)

##### New Member
if date is same in two or three different cloumn then we have identify these cases and check with mannuly what is exact error

#### AliGW

##### Banned
In that case, try this:

Excel 2016 (Windows) 32 bit
ABCDEFGH
1DateCodeDateCodeDateCodeMax DateCode on the basis of max date
201-Nov-1646105-Nov-16112430-Nov-16100830-Nov-161008
330-Nov-16113507-Dec-16109124-Dec-16108924-Dec-161089
406-Dec-16112406-Dec-16112610-Oct-1697906-Dec-16Error
515-Nov-16104901-Nov-16104814-Dec-16106014-Dec-161060
617-Oct-16106115-Sep-16106215-Sep-16108517-Oct-161061
701-Sep-16117308-May-16117204-Jul-16117001-Sep-161173
809-Aug-16117108-Mar-16120301-Nov-16120701-Nov-161207
Sheet1
Cell Formulas
RangeFormula
G2=MAX(\$A2:\$F2)
H2=IF(COUNTIF(\$A2:\$F2,G2)>1,"Error",LOOKUP(2,1/(\$A2:\$F2=G2),\$B2:\$G2))

##### New Member
Great

Thank you very much

it’s working

#### AliGW

##### Banned
You are most welcome.

Replies
3
Views
156
Replies
0
Views
309
Replies
5
Views
749
Replies
3
Views
318
Replies
6
Views
175

1,191,204
Messages
5,985,275
Members
439,953
Latest member
suchitha

### 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.

### Which adblocker are you using?

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

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