how to find the MAX month based on 2 criteria

slapman

New Member
Joined
Mar 4, 2020
Messages
9
Office Version
  1. 2013
hello all.

i have sales data with the following:
A B C D
Month-year | Part number | SALE QTY 2020 | SALE QTY 2019

02/2020 XXXX 2
.....
...
... XXXX 5
... ZZZZ 6
09/2019 YYYY 9
.....
...
... XXXX 12
... ZZZZ 6

in order to project the purchuses from the supplier im trying to i dentify the "PEAK" month of sales per year 2019 / 2020

the outcome should tell me what is the MONTH (not the value of QTY) which the peak occured.

>>> I have excel 2013 (maxIFS not availabe).

thank you very much.

eddie.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
sorry, the exaple turned bad in last post
uploading the example here:
in the PEAK column i need the answer per line, so the answer may duplicate , which is ok for me.

MONTH​
PN​
SALE QTY 2019​
SALE QTY 2020​
PEAK MONTH 2019​
PEAK MONTH 2020​
02/2019​
51601370200​
1​
??​
??​
04/2019​
51603502720​
4​
??​
??​
05/2019​
51601370200​
12​
??​
??​
08/2019​
51603502610​
2​
??​
??​
08/2019​
51603500350​
4​
??​
??​
09/2019​
51603500350​
9​
??​
??​
09/2019​
51603502720​
18​
??​
??​
01/2020​
51601370200​
0​
??​
??​
01/2020​
51603502610​
1​
??​
??​
02/2020​
51603500350​
1​
??​
??​

 
Upvote 0
hello all.

i have sales data with the following:

MONTHPNSALE QTY 2019SALE QTY 2020PEAK MONTH 2019PEAK MONTH 2020
02/2019516013702001????
04/2019516035027204????
05/20195160137020012????
08/2019516035026102????
08/2019516035003504????
09/2019516035003509????
09/20195160350272018????
01/2020516013702000????
01/2020516035026101????
02/2020516035003501????




n order to project the purchases from the supplier im trying to i identify the "PEAK" month of sales per year 2019 / 2020

the outcome should tell me what is the MONTH (not the value of QTY) which the peak occurred.

>>> I have excel 2013 (maxIFS not available).

thank you very much.

eddie.
 
Upvote 0
Welcome to the MrExcel board!

Always a good idea to include the expected results so we know what we are aiming for, For example, I'm unclear what result(s) you expect for 2020 where two months have equal top sales.

To get the first month with max sales, try these, copied down.

20 03 08.xlsm
ABCDEF
1MONTHPNSALE QTY 2019SALE QTY 2020PEAK MONTH 2019PEAK MONTH 2020
2Feb-19516013702001Sep-19Jan-20
3Apr-19516035027204Sep-19Jan-20
4May-195160137020012Sep-19Jan-20
5Aug-19516035026102Sep-19Jan-20
6Aug-19516035003504Sep-19Jan-20
7Sep-19516035003509Sep-19Jan-20
8Sep-195160350272018Sep-19Jan-20
9Jan-20516013702000Sep-19Jan-20
10Jan-20516035026101Sep-19Jan-20
11Feb-20516035003501Sep-19Jan-20
Peak
Cell Formulas
RangeFormula
E2:F11E2=INDEX($A$2:$A$11,MATCH(MAX(C$2:C$11),C$2:C$11,0))
 
Upvote 0
Welcome to the MrExcel board!

Always a good idea to include the expected results so we know what we are aiming for, For example, I'm unclear what result(s) you expect for 2020 where two months have equal top sales.

To get the first month with max sales, try these, copied down.

20 03 08.xlsm
ABCDEF
1MONTHPNSALE QTY 2019SALE QTY 2020PEAK MONTH 2019PEAK MONTH 2020
2Feb-19516013702001Sep-19Jan-20
3Apr-19516035027204Sep-19Jan-20
4May-195160137020012Sep-19Jan-20
5Aug-19516035026102Sep-19Jan-20
6Aug-19516035003504Sep-19Jan-20
7Sep-19516035003509Sep-19Jan-20
8Sep-195160350272018Sep-19Jan-20
9Jan-20516013702000Sep-19Jan-20
10Jan-20516035026101Sep-19Jan-20
11Feb-20516035003501Sep-19Jan-20
Peak
Cell Formulas
RangeFormula
E2:F11E2=INDEX($A$2:$A$11,MATCH(MAX(C$2:C$11),C$2:C$11,0))

thank you for your reply.

i just painted a picture , but basically there is no way in the world that two (or more) months will come out with the same results so i'm expecting to have an absolute 1 value to come out.
 
Upvote 0
Welcome to the MrExcel board!

Always a good idea to include the expected results so we know what we are aiming for, For example, I'm unclear what result(s) you expect for 2020 where two months have equal top sales.

To get the first month with max sales, try these, copied down.

Im sorry, i dont know how to edit my posts , so i have to open new post (please guide me if possible).
the formula you presented gives wrong result.

for 51601370200 result came sep-19
but in fact peak sales for that PN was in May-19.

the idea is to show the max sales month per PN by month (each year in separate)

thanks again.
 
Upvote 0
the idea is to show the max sales month per PN by month (each year in separate)
That part wan't mentioned originally. ;)
im trying to i dentify the "PEAK" month of sales per year 2019 / 2020

the outcome should tell me what is the MONTH (not the value of QTY) which the peak occured.
If this is not what you want, please post sample data and all expected results with explanation in relation to that sample data.

20 03 08.xlsm
ABCDEF
1MONTHPNSALE QTY 2019SALE QTY 2020PEAK MONTH 2019PEAK MONTH 2020
2Feb-19516013702001May-19 
3Apr-19516035027204Sep-19 
4May-195160137020012May-19 
5Aug-19516035026102Aug-19 
6Aug-19516035003504Sep-19 
7Sep-19516035003509Sep-19 
8Sep-195160350272018Sep-19 
9Jan-20516013702000 Jan-20
10Jan-20516035026101 Jan-20
11Feb-20516035003501 Feb-20
Peak
Cell Formulas
RangeFormula
E2:E11E2=IF(C2="","",AGGREGATE(14,6,A$2:A$11/((B$2:B$11=B2)*(C$2:C$11=AGGREGATE(14,6,C$2:C$11/(B$2:B$11=B2),1))),1))
F2:F11F2=IF(D2="","",AGGREGATE(14,6,A$2:A$11/((B$2:B$11=B2)*(D$2:D$11=AGGREGATE(14,6,D$2:D$11/(B$2:B$11=B2),1))),1))
 
Upvote 0
That part wan't mentioned originally. ;)
If this is not what you want, please post sample data and all expected results with explanation in relation to that sample data.

OMG!
You nailed it with an outer-space formula!
it worked and you have no idea how helpful it is to me.

1000s of thanks to you!
 
Upvote 0
OMG!
You nailed it with an outer-space formula!
it worked and you have no idea how helpful it is to me.

1000s of thanks to you!
You're welcome. Thanks for the enthusiastic follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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