Require formula

Ron99

Active Member
Joined
Feb 10, 2010
Messages
340
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I have data in rows

I need a max formula for the last 12 consecutive months.Formula should calculate value more than zero and the calculation should start from right.

Formula result should show For RON its 24 & Jude its 9.

JFMAMJJASONDJFMAMJJASONDJFMAMJJASOND
RON12208000062389480000000001689240013610
JUDE002569000000000000000000025800950023

<tbody>
</tbody>
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKAL
1JFMAMJJASONDJFMAMJJASONDJFMAMJJASOND
224RON12208000062389480000000001689240013610
39JUDE002569000000000000000000025800950023
Sheet1


In A2 control+shift+enter, not just enter, and copy down:

=MAX(IF(COLUMN(C2:AL2)>=LARGE(IF(ISNUMBER(1/C2:AL2),COLUMN(C2:AL2)),MIN(12,COUNTIFS(C2:AL2,">0"))),IF(ISNUMBER(1/C2:AL2),C2:AL2)))
 
Upvote 0
Excellent!! that worked. With the same scenario I have one more requirement.

I need a formula for the max 12 month in this range

max(sum(C2:N2),SUM(D2:O2),SUM(E2:P2)..and so on

Is there a better formula As I have range for 5 years by month.

Thanks,
Ron
 
Last edited:
Upvote 0
Excellent!! that worked.

Great.

With the same scenario I have one more requirement.

I need a formula for the max 12 month in this range

max(sum(C2:N2),SUM(D2:O2),SUM(E2:P2)..and so on

Is there a better formula As I have range for 5 years by month.

[…]

I don't understand the request neither the formula you provide as a description. Care to elaborate? Use a 3 months window instead of 12 for reasons of an easier explanation and layout.
 
Upvote 0
... I need a formula for the max 12 month in this range

max(sum(C2:N2),SUM(D2:O2),SUM(E2:P2)..and so on

Is there a better formula As I have range for 5 years by month...
See if the following array formula (to be entered using Ctrl+Shift+Enter, not just Enter) works for you:

=MAX(SUBTOTAL(9,OFFSET($C2,,ROW(INDIRECT("1:"&COUNT($C2:$ABC2)-11))-1,1,12)))
 
Upvote 0
For the original problem I think you could also use this standard-entry formula.
(If there is a row consisting of all 0 values this formula will return 0. If that is possible with your data and is a problem result for you, an amendment could be made)

Excel Workbook
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKAL
1JFMAMJJASONDJFMAMJJASONDJFMAMJJASOND
224RON12208000062389480000000001689240013610
39JUDE002569000000000000000000025800950023
Max
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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