# Find lastest date in row and detail which quarter it falls in

#### Godders199

##### Active Member
Hello, I am building a new spreadsheet and need to find the last date in a row and evidence which Quarter it falls in as per this example below.

 date 1 date 2 date3 Quarter 01/01/2018 01/06/2018 01/03/2018 Q2 01/03/2018 01/04/2018 01/07/2018 Q3
<colgroup><col width="75" style="width: 56pt; mso-width-source: userset; mso-width-alt: 2742;" span="3"> <col width="64" style="width: 48pt;"> <tbody> </tbody>

I now using =max(a1:a3) will give me th latest date ,but i dont know how to convert that to a quarter.

Also i am looking to convert his to vba, as i am trying to avoid any formulas in worksheet, to keep it functioning efficiently.

Hope someone can hel.

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

#### njimack

##### Well-known Member
The formula would be:
PHP:
``="Q"&ROUNDUP(MONTH(MAX(A2:C2))/3,0)``
The VBA would be:
Code:
``Range("D2").FormulaR1C1 = "=""Q""&ROUNDUP(MONTH(MAX(RC[-3]:RC[-1]))/3,0)"``

#### Godders199

##### Active Member
Thanks for the formula.

Would that VBA just put the formula in cell d2?which i trying to avoid ,just really want to see the result. Iwill give it ago and see what impact it has on the workbook.

#### njimack

##### Well-known Member
Code:
``````    With Range("D2")
.FormulaR1C1 = "=""Q""&ROUNDUP(MONTH(MAX(RC[-3]:RC[-1]))/3,0)"
.Formula = .Value
End With``````

Replies
4
Views
217
Replies
3
Views
321
Replies
5
Views
332
Replies
3
Views
553
Replies
5
Views
854

1,181,249
Messages
5,928,911
Members
436,634
Latest member
JimHHH

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