Figures based on month selection

Salamullah

Board Regular
Joined
Mar 28, 2011
Messages
221
Hi Experts - Please give any formula

I want to get the figures in row 3 for each month based on selection of month in cell A1 as per the given example below, in Mar and Apr figures are showing zero
Suppose if I select Mar in A1 only Apr should show zero rest of the months should take sum from array F6:G11

[TABLE="width: 500"]
<tbody>[TR]
[TD]Feb[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Jan[/TD]
[TD]Feb[/TD]
[TD]Mar[/TD]
[TD]Apr[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sales[/TD]
[TD]200[/TD]
[TD]400[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Month[/TD]
[TD]Sales[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jan
[/TD]
[TD]200
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Feb[/TD]
[TD]100[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Feb[/TD]
[TD]300[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Mar[/TD]
[TD]500[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Mar[/TD]
[TD]100[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Apr[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
if I select Mar in A1 only Apr should show zero and not May, June etc ...?



 
Upvote 0
Let's assume data Month/sales is in range K2 to L15
Months name are in range O1 : O12 = Jan, Feb, MAr ...Nov, Dec
B4 = =IF(MATCH(B2,$O$1:$O$12,0)<=MATCH($A$1,$O$1:$O$12,0),SUMPRODUCT(($K$2:$K$15=B2)*($L$2:$L$15)),0)
Copy and paste until the last column of display .. E4
 
Upvote 0
I have used the below with your given formula, only the issue its giving FALSE instead of Zero. What I am missing ?

[TABLE="width: 480"]
<colgroup><col><col span="5"></colgroup><tbody>[TR]
[TD="align: left"]Feb[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: left"]Jan[/TD]
[TD="align: left"]Feb[/TD]
[TD="align: left"]Mar[/TD]
[TD="align: left"]Apr[/TD]
[TD="align: left"]May[/TD]
[/TR]
[TR]
[TD="align: left"]Sales[/TD]
[TD="align: left"] 1,239,737[/TD]
[TD="align: left"] 2,793,474[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
</tbody>[/TABLE]

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]=IF(MATCH(E5,$E$5:$P$5,0)<=MATCH($A$3,$E$5:$P$5,0),SUMIFS(Table_Query_from_TB3[SDITVL],Table_Query_from_TB3[Month],E$5,Table_Query_from_TB3[SDAN8],Sales!$F$8))

[/FONT]
 
Upvote 0
=IF(MATCH(E5,$E$5:$P$5,0)<=MATCH($A$3,$E$5:$P$5,0),SUMIFS(Table_Query_from_TB3[SDITVL],Table_Query_from_TB3[Month],E$5,Table_Query_from_TB3[SDAN8],Sales!$F$8),0)
 
Upvote 0
It seems was missing the end of the formula when you copied it...!
You know that instead of using text for month name ( e.g. Jan, Feb ...) you coukd use date ( 1/1/2019) and format the cell to display only the month: Custom Format Type "mmm"
It will be more simple.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,217
Members
452,619
Latest member
Shiv1198

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