SOLVED

Formula to check if the month and year of 2 cells are the same except for certain circumstances

%3CLINGO-SUB%20id%3D%22lingo-sub-1436191%22%20slang%3D%22en-US%22%3EFormula%20to%20check%20if%20the%20month%20and%20year%20of%202%20cells%20are%20the%20same%20except%20for%20certain%20circumstances%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1436191%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20formula%20to%20check%20if%20the%20month%20and%20year%20of%202%20cells%20are%20the%20same%20with%20a%20result%20of%20True%20or%20False%2C%20however%2C%20I%20need%20to%20add%20another%20step%20to%20the%20formula%20to%20return%20True%20even%20if%20the%20mm%2Fyy%20aren't%20the%20same%20if%20another%20column%20has%20a%20specific%20statement.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EColumn%20A%20%3D%20Description%3C%2FP%3E%3CP%3EColumn%20B%20%3D%20Date%201%3C%2FP%3E%3CP%3EColumn%20C%20%3D%20Date%202%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20current%20formula%20is%3A%20%3DMonth(B1)%26amp%3BYear(B1)%3DMonth(C1)%26amp%3BYear(C1)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20description%20column%20may%20say%20Shares%20Issued%2C%20Distribution%20Payment%20or%20Shares%20Redeemed%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1436191%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1436629%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20to%20check%20if%20the%20month%20and%20year%20of%202%20cells%20are%20the%20same%20except%20for%20certain%20circumstances%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1436629%22%20slang%3D%22en-US%22%3EHi%20Charlie%2C%3CBR%20%2F%3E%3CBR%20%2F%3EYou%20should%20use%20a%20simple%20nested%20IF%20here.%20Rather%20than%20do%20%3DMonth%26amp%3BYear%3DMonth%26amp%3BYear%20to%20get%20your%20true%2Ffalse%2C%20start%20from%20an%20IF%20statement.%3CBR%20%2F%3E%3DIF(Month(B1)%26amp%3BYear(B1)%3DMonth(C1)%26amp%3BYear(C1)%2CTrue%2CFalse)%3CBR%20%2F%3EThis%20will%20get%20your%20match%20on%20month%2Fyear%20like%20you%20currently%20do%2C%20and%20makes%20expanding%20and%20doing%20other%20things%20much%20easier.%20So%20what%20we're%20going%20to%20do%20now%20is%20check%20for%20the%20specific%20statement%2C%20before%20checking%20your%20dates.%20For%20example%20if%20you%20want%20to%20check%20for%20%22Shares%20Issued%22%20in%20column%20A%2C%20and%20return%20true%20regardless%20of%20dates%2C%20but%20then%20still%20return%20true%20for%20any%20dates%20that%20are%20in%20fact%20matching%20regardless%20of%20description%2C%20you%20could%20say%3A%3CBR%20%2F%3E%3CBR%20%2F%3EIF(A1%3D%22Shared%20Issued%22%2CTrue%2CIF(Month(B1)%26amp%3BYear(B1)%3DMonth(C1)%26amp%3BYear(C1)%2CTrue%2CFalse))%3CBR%20%2F%3E%3CBR%20%2F%3ENow%20I'm%20the%20type%20of%20person%20that%20likes%20to%20have%20informative%20statements%20instead%20of%20True%2FFalse.%20I%20also%20don't%20like%20seeing%2010%20lines%20of%20%22FALSE%22%20in%20between%20my%20true%20records%2C%20I'd%20rather%20the%20falses%20show%20up%20blank%20so%20I%20can%20more%20quickly%20identify%20my%20true%20statements.%20The%20human%20eye%20can%20find%20all%20the%20true%20text%20when%20there's%20no%20blanks%20significantly%20faster.%20So%20replace%20your%20true%20and%20false%20returns%20with%20what%20you%20want%20it%20to%20say%20instead.%20Example%3A%3CBR%20%2F%3E%3CBR%20%2F%3EIF(A1%3D%22Shares%20Issued%22%2C%22Shares%20Issued%22%2CIF(Month(B1)%26amp%3BYear(B1)%3DMonth(C1)%26amp%3BYear(C1)%2C%22MATCH!%22%2C%22%22))%3CBR%20%2F%3E%3CBR%20%2F%3ENow%20if%20the%20description%20column%20says%20the%20shares%20were%20issued%2C%20that's%20what%20your%20formula%20returns.%20But%20if%20it%20doesn't%20say%20that%20it%20checks%20if%20the%20dates%20match.%20If%20the%20dates%20match%20it%20tells%20you!%20If%20not%2C%20then%20it%20just%20returns%20blank%2C%20to%20make%20viewing%20your%20data%20much%20easier.%3CBR%20%2F%3E%3CBR%20%2F%3EHope%20this%20helps!%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

I have a formula to check if the month and year of 2 cells are the same with a result of True or False, however, I need to add another step to the formula to return True even if the mm/yy aren't the same if another column has a specific statement.

 

Column A = Description

Column B = Date 1

Column C = Date 2

 

My current formula is: =Month(B1)&Year(B1)=Month(C1)&Year(C1)

 

The description column may say Shares Issued, Distribution Payment or Shares Redeemed

 

 

1 Reply
Highlighted
Solution
Hi Charlie,

You should use a simple nested IF here. Rather than do =Month&Year=Month&Year to get your true/false, start from an IF statement.
=IF(Month(B1)&Year(B1)=Month(C1)&Year(C1),True,False)
This will get your match on month/year like you currently do, and makes expanding and doing other things much easier. So what we're going to do now is check for the specific statement, before checking your dates. For example if you want to check for "Shares Issued" in column A, and return true regardless of dates, but then still return true for any dates that are in fact matching regardless of description, you could say:

IF(A1="Shared Issued",True,IF(Month(B1)&Year(B1)=Month(C1)&Year(C1),True,False))

Now I'm the type of person that likes to have informative statements instead of True/False. I also don't like seeing 10 lines of "FALSE" in between my true records, I'd rather the falses show up blank so I can more quickly identify my true statements. The human eye can find all the true text when there's no blanks significantly faster. So replace your true and false returns with what you want it to say instead. Example:

IF(A1="Shares Issued","Shares Issued",IF(Month(B1)&Year(B1)=Month(C1)&Year(C1),"MATCH!",""))

Now if the description column says the shares were issued, that's what your formula returns. But if it doesn't say that it checks if the dates match. If the dates match it tells you! If not, then it just returns blank, to make viewing your data much easier.

Hope this helps!