Need help with formula tied to dates. Nested IF formula.

Drummerboy1

New Member
Joined
Sep 30, 2021
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
I'm going crazy! I've been trying to get his formula to work for 2 days and I am finally throwing in the towel. Any help would be MUCH appreciated.

On this example Google Sheet:

As the Sheet above explains, I'm trying to do a nested IF formula to accomplish the 4 rules:

Rule 1: If CELL IN column B is blank, leave all corresponding cells (G2:S2) blank
Rule 2: If the date in G$2:S$2 is AFTER the date in Cell $F$1, leave it blank
Rule 3: If the date in B3:B12 is the SAME MONTH, and SAME YEAR, as the dates in G2:S2, put a "2"
Rule 4: Put "1"s in all other cells

Any help you can provide would be SO helpful. I'm not an excel or Google Sheets pro by any means, and I usually find a way to stumble through to the results I need. I can't seem to fix this one though.

Thank you in advance!

Rich
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Here is the formula I'm trying to fix:

=IF($B3="","",IF(G$2>$F$1,"",IF(month($B3)&year($B3)>month(G$2)&YEAR(G$2),"",IF(month($B3)&year($B3)=month(L$2)&YEAR(L$2),2,1))))

And a screenshot below.
 

Attachments

  • Screen Shot.png
    Screen Shot.png
    145.9 KB · Views: 12
Upvote 0
Book1
BCDEFGHIJKL
101 December 2021
2Install Date01 July 202101 August 202101 September 202101 October 202101 November 202101 December 2021
304 August 2021121111
404 August 2021121111
501 October 2021111211
602 January 2021111111
704 September 2021112111
831 August 2021121111
901 June 2021111111
1031 December 2021111112
1105 August 2021121111
1205 August 2021121111
Sheet1
Cell Formulas
RangeFormula
G3:L12G3=IF(OR($B3="",G$2>$F$1),"",1+(MONTH($B3)&YEAR($B3)=MONTH(G$2)&YEAR(G$2)))
 
Upvote 0
Solution
Same concept as @snjpverma but a bit shorter way of writing it

21 10 01.xlsm
BCDEFGHIJKLM
101 December 2021
2Install Date01 July 202101 August 202101 September 202101 October 202101 November 202101 December 202101 January 2022
304-August-2021121111 
404-August-2021121111 
501-October-2021111211 
602-January-2021111111 
704-September-2021112111 
831-August-2021121111 
901-June-2021111111 
1031-December-2021111112 
1105-August-2021121111 
1205-August-2021121111 
Month & Year
Cell Formulas
RangeFormula
G3:M12G3=IF(OR($B3="",G$2>$F$1),"",1+(TEXT($B3,"myy")=TEXT(G$2,"myy")))
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,734
Members
448,987
Latest member
marion_davis

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