Calculating Number of Months Before/After a Specific Date Between Two Dates

%3CLINGO-SUB%20id%3D%22lingo-sub-2257785%22%20slang%3D%22en-US%22%3ECalculating%20Number%20of%20Months%20Before%2FAfter%20a%20Specific%20Date%20Between%20Two%20Dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2257785%22%20slang%3D%22en-US%22%3E%3CP%3EOperating%20System%3A%20Windows%2010%20Version%2020H2%2C%2064-bit%20operating%20system%3C%2FP%3E%3CP%3EExcel%20Product%3A%20Microsoft%20Office%20Professional%20Plus%202016%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20everyone%20is%20having%20a%20good%20day%20and%20thanks%20in%20advance%20for%20all%20those%20who%20are%20willing%20to%20offer%20their%20input.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20calculate%20the%20total%20months%20before%20and%20after%20a%20certain%20date%20within%20a%20certain%20period%20of%20performance.%20The%20dates%20for%20the%20Period%20of%20Performance%20are%20directly%20linked%20to%20the%20%22Budget%22%20tab%20and%20will%20vary%20from%20project%20to%20project.%20For%20our%20organization%2C%20faculty%20receive%20salary%20increases%20effective%20July%201%20of%20each%20year%20and%20staff%20receive%20salary%20increases%20as%20of%201%2F1%20of%20each%20year.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20purposes%20of%20the%20spreadsheet%2C%20I%20am%20looking%20to%20calculate%20the%20total%20months%20before%20and%20after%20July%201st%20and%20January%201st%20for%20each%20budget%20period.%20I%20will%20then%20incorporate%20this%20information%20into%20the%20%22Request%22%20calculations%20in%20columns%20K%2C%20M%2C%20O%2C%20Q%2C%20S%20to%20calculate%20a%20weighted%20average%20salary%20cost%20for%20each%20individual%20who%20is%20budgeted%20on%20the%20project.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%2C%20with%20the%20current%20sample%20budget%20period%2C%20I%20want%20cell%20G5%20to%20output%205%20and%20cell%20H5%20to%20output%207.%20For%20cell%20I5%2C%20I%20want%20it%20to%20output%2011%20and%20for%20cell%20J5%2C%20I%20want%20it%20to%20output%201.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20open%20to%20changing%20any%20cells%20if%20needed.%20This%20format%20was%20only%20meant%20to%20help%20me%20visualize%20what%20I%20was%20trying%20to%20figure%20out.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2257785%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2258159%22%20slang%3D%22en-US%22%3ERe%3A%20Calculating%20Number%20of%20Months%20Before%2FAfter%20a%20Specific%20Date%20Between%20Two%20Dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2258159%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1018755%22%20target%3D%22_blank%22%3E%40aagoldman%3C%2FA%3E%26nbsp%3BAttached%20a%20possible%20solution%20for%20you.%20not%20very%20straight-forward%20and%20certainly%20not%20very%20pretty.%20But%2C%20I%20think%20it%20works%20as%20intended.%20I've%20introduced%20a%20few%20names%20ranges%20to%20keep%20the%20formulae%20easier%20to%20follow.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2261900%22%20slang%3D%22en-US%22%3ERe%3A%20Calculating%20Number%20of%20Months%20Before%2FAfter%20a%20Specific%20Date%20Between%20Two%20Dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2261900%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3BThank%20you!%20This%20seems%20functional%20and%20produces%20the%20results%20I%20was%20looking%20for.%20Now%2C%20I%20will%20try%20to%20examine%20the%20formula%20and%20try%20to%20understand%20it%20so%20I%20can%20explain%20it%20to%20my%20colleagues.%20I%20really%20appreciate%20your%20assistance.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Operating System: Windows 10 Version 20H2, 64-bit operating system

Excel Product: Microsoft Office Professional Plus 2016

 

I hope everyone is having a good day and thanks in advance for all those who are willing to offer their input.

 

I am trying to calculate the total months before and after a certain date within a certain period of performance. The dates for the Period of Performance are directly linked to the "Budget" tab and will vary from project to project. For our organization, faculty receive salary increases effective July 1 of each year and staff receive salary increases as of 1/1 of each year. 

 

For purposes of the spreadsheet, I am looking to calculate the total months before and after July 1st and January 1st for each budget period. I will then incorporate this information into the "Request" calculations in columns K, M, O, Q, S to calculate a weighted average salary cost for each individual who is budgeted on the project. 

 

For example, with the current sample budget period, I want cell G5 to output 5 and cell H5 to output 7. For cell I5, I want it to output 11 and for cell J5, I want it to output 1. 

 

I am open to changing any cells if needed. This format was only meant to help me visualize what I was trying to figure out. 

 

Thanks!

3 Replies

@aagoldman Attached a possible solution for you. not very straight-forward and certainly not very pretty. But, I think it works as intended. I've introduced a few names ranges to keep the formulae easier to follow. 

@Riny_van_Eekelen Thank you! This seems functional and produces the results I was looking for. Now, I will try to examine the formula and try to understand it so I can explain it to my colleagues. I really appreciate your assistance. 

@aagoldman Glad it worked. And when you examine the formula, break it down in smaller pieces and see what every part is "doing". Not very straight-forward, I must admit. Come back here if you need more help.