Formula relating to a date of birth and a retirement date

leopardhawk

Well-known Member
Joined
May 31, 2007
Messages
611
Office Version
  1. 2016
Platform
  1. Windows
Hello forum friends, I need help with a formula (actually, three formulas) that will return data from two other worksheets. I will paste in the sections of my worksheet and try to explain as best as I can.

This first section is on the 'income' worksheet and contains two columns with dates in one column and the other contains a dollar amount. I have only pasted a small section here, it actually extends out to row 500.


Excel 2016 (Windows) 32 bit
FGH
11Date paidAmount (gross)
12yyyy-mm-dd$ -
13yyyy-mm-dd$ -
14yyyy-mm-dd$ -
15yyyy-mm-dd$ -
16yyyy-mm-dd$ -
17yyyy-mm-dd$ -
18yyyy-mm-dd$ -
19yyyy-mm-dd$ -
20yyyy-mm-dd$ -
21yyyy-mm-dd$ -
income
The second section is on the 'personal_info' worksheet and contains a date of birth for the user of the workbook.


Excel 2016 (Windows) 32 bit
CDE
7FirstLastDate of birth
8
9
personal_info
The section from the worksheet where I need the formula to reside (cell F24) is shown below.


Excel 2016 (Windows) 32 bit
EF
24Average Gross Payroll (if applicable)$ -
income_analysis
To explain... first and foremost, if column H on the 'income' worksheet is blank, the formula should always return zero (0). If there is anything in column H on the 'income' worksheet, the formula will return the AVERAGE of any dollar amounts in column H that are earned while the user is under 65 years of age.

So, assuming I can get a formula working in F24, and this is where it might get a bit complicated, if the user is between 65 and 70 years of age, I need another formula in F50 (see below) that will return the AVERAGE of any dollar amounts in column H that were earned during that time period.


Excel 2016 (Windows) 32 bit
EF
50Average Gross Payroll (if applicable)$ -
income_analysis
And, if the user is over 70 years of age, I need another formula in F77 (see below) that will return the AVERAGE of any dollar amounts that are earned after the user turns 70 years old.


Excel 2016 (Windows) 32 bit
EF
77Average Gross Payroll (if applicable)$ -
income_analysis
I hope this makes sense and that someone is willing to help me out.

Cheers!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Re: Need help with formula relating to a date of birth and a retirement date

Hi,

Try this:

Formula in F24: =IFERROR(AVERAGEIFS(Income!H12:H500,Income!F12:F500,"<"&EDATE(personal_info!E8,(65*12))),0)
Formula in F50: =IFERROR(AVERAGEIFS(Income!H12:H500,Income!F12:F500,">="&EDATE(personal_info!E8,(65*12)),Income!F12:F500;"<"&EDATE(personal_info!E8,(70*12))),0)
Formula in F77: =IFERROR(AVERAGEIFS(Income!H12:H500,Income!F12:F500,">="&EDATE(personal_info!E8,(70*12))),0)
 
Upvote 0
Re: Need help with formula relating to a date of birth and a retirement date

Thank you so much for your efforts. The first formula and the third seem to work okay but the second one is giving me an error (There's a problem with this formula.) When I copy/paste it into the cell and hit enter. Any ideas?

Thanks!
 
Upvote 0
Re: Need help with formula relating to a date of birth and a retirement date

Okay, I found the problem, the second formula had a semicolon (;) instead of a comma (,). It is now working as intended.

Cheers!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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