Month is filtered and previous month are zeroed

joetejas

New Member
Joined
Feb 5, 2019
Messages
17
Hello,
I have columns Jan-Dec 2019 with a IF formula already in the cells. I need to figure out how to enter a formula that can zero out the previous month when selected, but keep the rest of the years data.
For example when I filter to Mar, the current data stays and Jan&Feb will equal to zero.
The month is filtered from another tab.

R82HDmSa5gLPgAAAABJRU5ErkJggg==



thanks in advance
 

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.
I feel like this sounds like Pivot Table work. choose what variables you want to see and the others disappear.
 
Upvote 0
Example to what I want it to look like. sorry my pic will not paste, bold is rows,columns

A
1
Mar
B
C
D
E
2 Avg Rate 19
Jan 19
Feb 19 Mar 19 Apr 19
3 $2.92
$0$0########($74,231)
4$0.49
$0$0$0$0
5$2.96
$0$0($44,092)($62,158)

<colgroup><col span="5"></colgroup><tbody>
</tbody>

Formula that exists in cell B3.
=IF($I4="Other - Explain in Comments",((AD4-$AC4)/$AC4)*P4,IF(AP4>0,((P4*AP4*((AD4-$BB4)/$BB4))+(((VLOOKUP($C4,'Market Input'!$G:$AL,BD$1,FALSE)-$BB4)/$BB4)*P4*(1-AP4))),((VLOOKUP($C4,'Market Input'!$G:$AL,BD$1,FALSE)-$BB4)/$BB4)*P4))

The Formula is similar throughout all the cells.

A1, is the month selected from the other tab. In the current sheet it reads ='Market Input'!J1 and does not select, just a reference for column A.
So for every month I would like to read-out but the previous month is zero value. Basically a rolling forecast, but can be select in another tab.
 
Last edited:
Upvote 0
Ok so if your original question was that you wanted all the months except the one that was selected and that would appear in Cell A1 below to show Zero, then you should just add another IF statement to check the month in front of the formula you wrote below.

Like this: =IF(a1=b2,IF($I4="Other - Explain in Comments",((AD4-$AC4)/$AC4)*P4,IF(AP4>0,((P4*AP4*((AD4-$BB4)/$BB4))+(((VLOOKUP($C4,'Market Input'!$G:$AL,BD$1,FALSE)-$BB4)/$BB4)*P4*(1-AP4))),((VLOOKUP($C4,'Market Input'!$G:$AL,BD$1,FALSE)-$BB4)/$BB4)*P4)),0)

Example to what I want it to look like. sorry my pic will not paste, bold is rows,columns

A
1
Mar
B
C
D
E
2 Avg Rate 19 Jan 19 Feb 19Mar 19Apr 19
3 $2.92$0$0########($74,231)
4$0.49$0$0$0$0
5$2.96$0$0($44,092)($62,158)

<tbody>
</tbody>

Formula that exists in cell B3.
=IF($I4="Other - Explain in Comments",((AD4-$AC4)/$AC4)*P4,IF(AP4>0,((P4*AP4*((AD4-$BB4)/$BB4))+(((VLOOKUP($C4,'Market Input'!$G:$AL,BD$1,FALSE)-$BB4)/$BB4)*P4*(1-AP4))),((VLOOKUP($C4,'Market Input'!$G:$AL,BD$1,FALSE)-$BB4)/$BB4)*P4))

The Formula is similar throughout all the cells.

A1, is the month selected from the other tab. In the current sheet it reads ='Market Input'!J1 and does not select, just a reference for column A.
So for every month I would like to read-out but the previous month is zero value. Basically a rolling forecast, but can be select in another tab.
 
Upvote 0
Excellent! I had to adjust a few things to make it work. I want to keep values in the forward months.
Do I have to place another IF statement in to keep the values on the forward months, March, APR, May through Dec?

For example Jan and Feb equal 0.
But the remaining columns read values as below
Mar
AprMayJun
JulAugSepOctNovDec
($104,409)($74,231)($75,549)($86,588)($71,643)($61,592)($80,771)($76,167)($73,308)($100,569)

<colgroup><col style="mso-width-source:userset;mso-width-alt:3072;mso-outline-level: 1;width:63pt" width="84"> <col style="mso-width-source:userset;mso-width-alt:3072;mso-outline-level: 1;width:63pt" width="84"> <col style="mso-width-source:userset;mso-width-alt:3072;mso-outline-level: 1;width:63pt" width="84"> <col style="mso-width-source:userset;mso-width-alt:3072;mso-outline-level: 1;width:63pt" width="84"> <col style="mso-width-source:userset;mso-width-alt:3072;mso-outline-level: 1;width:63pt" width="84"> <col style="mso-width-source:userset;mso-width-alt:3328;mso-outline-level: 1;width:68pt" width="91"> <col style="mso-width-source:userset;mso-width-alt:3072;mso-outline-level: 1;width:63pt" width="84"> <col style="mso-width-source:userset;mso-width-alt:3072;mso-outline-level: 1;width:63pt" width="84"> <col style="mso-width-source:userset;mso-width-alt:3035;mso-outline-level: 1;width:62pt" width="83"> <col style="mso-width-source:userset;mso-width-alt:3218;mso-outline-level: 1;width:66pt" width="88"> </colgroup><tbody>
</tbody>



Like this: =IF(a1=b2,IF($I4="Other - Explain in Comments",((AD4-$AC4)/$AC4)*P4,IF(AP4>0,((P4*AP4*((AD4-$BB4)/$BB4))+(((VLOOKUP($C4,'Market Input'!$G:$AL,BD$1,FALSE)-$BB4)/$BB4)*P4*(1-AP4))),((VLOOKUP($C4,'Market Input'!$G:$AL,BD$1,FALSE)-$BB4)/$BB4)*P4)),0)[/QUOTE]
 
Upvote 0
It's not the most efficient way and i'm sure others on here would have something much simpler but i would just create a lookup table for the months and use a Vlookup nested in the IF statement to see if the month is greater than the one selected.

would look like this:
Jan1
Feb2
Mar3
Apr4
May5
Jun6
Jul7
Aug8
Sep9
Oct10
Nov11
Dec12


<colgroup><col style="width: 64px" span="2"></colgroup><tbody>
</tbody>

Excellent! I had to adjust a few things to make it work. I want to keep values in the forward months.
Do I have to place another IF statement in to keep the values on the forward months, March, APR, May through Dec?

For example Jan and Feb equal 0.
But the remaining columns read values as below
MarAprMayJunJulAugSepOctNovDec
($104,409)($74,231)($75,549)($86,588)($71,643)($61,592)($80,771)($76,167)($73,308)($100,569)

<tbody>
</tbody>



Like this: =IF(a1=b2,IF($I4="Other - Explain in Comments",((AD4-$AC4)/$AC4)*P4,IF(AP4>0,((P4*AP4*((AD4-$BB4)/$BB4))+(((VLOOKUP($C4,'Market Input'!$G:$AL,BD$1,FALSE)-$BB4)/$BB4)*P4*(1-AP4))),((VLOOKUP($C4,'Market Input'!$G:$AL,BD$1,FALSE)-$BB4)/$BB4)*P4)),0)
[/QUOTE]
 
Upvote 0
I have tried the VLookup and tried to find a way the selector could months outside the selector I could reference.
VLookup, I am having a problem nesting in the new IF statement.
 
Upvote 0
Show me the formula you're using and what the range is for the table of the months.

I have tried the VLookup and tried to find a way the selector could months outside the selector I could reference.
VLookup, I am having a problem nesting in the new IF statement.
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,741
Members
449,050
Latest member
excelknuckles

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