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

Godders199

Active Member
Joined
Mar 2, 2017
Messages
313
Office Version
  1. 2013
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.

[TABLE="width: 216"]
<colgroup><col width="75" style="width: 56pt; mso-width-source: userset; mso-width-alt: 2742;" span="3"> <col width="64" style="width: 48pt;"> <tbody>[TR]
[TD="width: 75, bgcolor: transparent"]date 1[/TD]
[TD="width: 75, bgcolor: transparent"]date 2[/TD]
[TD="width: 75, bgcolor: transparent"]date3[/TD]
[TD="width: 64, bgcolor: transparent"]Quarter[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]01/01/2018[/TD]
[TD="bgcolor: transparent, align: right"]01/06/2018[/TD]
[TD="bgcolor: transparent, align: right"]01/03/2018[/TD]
[TD="bgcolor: transparent"]Q2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]01/03/2018[/TD]
[TD="bgcolor: transparent, align: right"]01/04/2018[/TD]
[TD="bgcolor: transparent, align: right"]01/07/2018[/TD]
[TD="bgcolor: transparent"]Q3[/TD]
[/TR]
</tbody>[/TABLE]

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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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)"
 
Upvote 0
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.
 
Upvote 0
Code:
    With Range("D2")
        .FormulaR1C1 = "=""Q""&ROUNDUP(MONTH(MAX(RC[-3]:RC[-1]))/3,0)"
        .Formula = .Value
    End With
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

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