Can't understand why two values are different

leopardhawk

Active Member
Joined
May 31, 2007
Messages
356
Office Version
2016
Platform
Windows
Hello forum friends, I am testing a workbook to make sure there are no errors and I am having problems figuring out why these two values are different when they should be exactly the same. If anyone has any ideas as to why, I will be very grateful.

There are two columns on one worksheet (income), one with dates that are two weeks apart and the other with dollar amounts (see below). This formula returns $947.03.
Code:
=AVERAGE(H12:H33)
The other worksheet (personal_info) has a date of birth for the user (see below).

This formula returns $990.08, a difference of $43.05! This is what I can't figure out, if the user is under 65 years of age, the formula should be returning the same amount, no?
Code:
=IFERROR(AVERAGEIFS(income!H12:H500,income!F12:F500,"<"&EDATE(personal_info!E9,(65*12))),0)
<b>Excel 2016 (Windows) 32 bit</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #B6AAA6"><colgroup><col width="25px" style="background-color: #E0E0F0 " /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0 ;text-align: center;color: #201116"><th></th><th>F</th><th>G</th><th>H</th></tr></thead><tbody><tr ><td style="color: #201116;text-align: center;">12</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2017-08-18</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 649.33 </td></tr><tr ><td style="color: #201116;text-align: center;">13</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2017-09-01</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 490.24 </td></tr><tr ><td style="color: #201116;text-align: center;">14</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2017-09-15</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 655.48 </td></tr><tr ><td style="color: #201116;text-align: center;">15</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2017-10-13</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 360.70 </td></tr><tr ><td style="color: #201116;text-align: center;">16</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2017-10-27</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,587.13 </td></tr><tr ><td style="color: #201116;text-align: center;">17</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2017-11-10</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 827.74 </td></tr><tr ><td style="color: #201116;text-align: center;">18</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2017-11-24</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 459.91 </td></tr><tr ><td style="color: #201116;text-align: center;">19</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2017-12-08</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,622.77 </td></tr><tr ><td style="color: #201116;text-align: center;">20</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2017-12-22</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,242.05 </td></tr><tr ><td style="color: #201116;text-align: center;">21</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-01-05</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,140.84 </td></tr><tr ><td style="color: #201116;text-align: center;">22</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-04-13</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 474.12 </td></tr><tr ><td style="color: #201116;text-align: center;">23</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-04-27</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,365.53 </td></tr><tr ><td style="color: #201116;text-align: center;">24</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-05-11</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,503.07 </td></tr><tr ><td style="color: #201116;text-align: center;">25</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-05-25</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 520.41 </td></tr><tr ><td style="color: #201116;text-align: center;">26</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-06-08</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 906.12 </td></tr><tr ><td style="color: #201116;text-align: center;">27</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-06-22</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,222.30 </td></tr><tr ><td style="color: #201116;text-align: center;">28</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-07-06</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 710.66 </td></tr><tr ><td style="color: #201116;text-align: center;">29</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-07-20</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,336.39 </td></tr><tr ><td style="color: #201116;text-align: center;">30</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-08-03</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 364.27 </td></tr><tr ><td style="color: #201116;text-align: center;">31</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-08-17</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,535.57 </td></tr><tr ><td style="color: #201116;text-align: center;">32</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-08-31</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,931.79 </td></tr><tr ><td style="color: #201116;text-align: center;">33</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-09-14</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 875.29 </td></tr><tr ><td style="color: #201116;text-align: center;">34</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-09-28</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,066.78 </td></tr><tr ><td style="color: #201116;text-align: center;">35</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-10-12</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 124.75 </td></tr><tr ><td style="color: #201116;text-align: center;">36</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-11-09</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 368.40 </td></tr><tr ><td style="color: #201116;text-align: center;">37</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-11-23</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,128.81 </td></tr><tr ><td style="color: #201116;text-align: center;">38</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-12-07</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 437.85 </td></tr><tr ><td style="color: #201116;text-align: center;">39</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2018-12-21</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 665.36 </td></tr><tr ><td style="color: #201116;text-align: center;">40</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-01-04</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,279.62 </td></tr><tr ><td style="color: #201116;text-align: center;">41</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-01-18</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,435.47 </td></tr><tr ><td style="color: #201116;text-align: center;">42</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-02-01</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 1,266.38 </td></tr><tr ><td style="color: #201116;text-align: center;">43</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-02-15</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 246.81 </td></tr><tr ><td style="color: #201116;text-align: center;">44</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-05-10</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 971.00 </td></tr><tr ><td style="color: #201116;text-align: center;">45</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-05-24</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 872.42 </td></tr><tr ><td style="color: #201116;text-align: center;">46</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-06-07</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 826.59 </td></tr><tr ><td style="color: #201116;text-align: center;">47</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-06-21</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 727.93 </td></tr><tr ><td style="color: #201116;text-align: center;">48</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-07-05</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 514.64 </td></tr><tr ><td style="color: #201116;text-align: center;">49</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-07-19</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 994.67 </td></tr><tr ><td style="color: #201116;text-align: center;">50</td><td style="font-weight: bold;text-align: right;font-style: italic;background-color: rgb(112, 173, 71);;">2019-08-02</td><td style="text-align: right;;"></td><td style="text-align: right;background-color: rgb(112, 173, 71);;"> $ 588.82 </td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #B6AAA6;border-top:none;text-align: center;background-color: #E0E0F0 ;color: #201116">income</p><br /><br />

<b>Excel 2016 (Windows) 32 bit</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #B6AAA6"><colgroup><col width="25px" style="background-color: #E0E0F0 " /><col /></colgroup><thead><tr style=" background-color: #E0E0F0 ;text-align: center;color: #201116"><th></th><th>E</th></tr></thead><tbody><tr ><td style="color: #201116;text-align: center;">7</td><td style="font-weight: bold;text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;font-style: italic;background-color: rgb(180, 198, 231);;">Date of Birth</td></tr><tr ><td style="color: #201116;text-align: center;">8</td><td style="text-align: right;border-top: 1px solid black;border-bottom: 1px solid black;background-color: rgb(191, 191, 191);;"></td></tr><tr ><td style="color: #201116;text-align: center;">9</td><td style="text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;font-style: italic;background-color: rgb(112, 173, 71);;">1953-09-23</td></tr></tbody></table><p style="width:7.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #B6AAA6;border-top:none;text-align: center;background-color: #E0E0F0 ;color: #201116">personal_info</p><br /><br />
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,206
Office Version
365
Platform
Windows
With that data both formulae return $990.08
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,480
Office Version
365
Platform
Windows
When I copied your data, this formula:
Code:
=AVERAGE(H12:H33)
returned $990.08 for me (as did the other formula).

Are you sure that you have place that formula on the correct page?

Check to see what these formulas return:
=COUNTIF(F12:F33,">0")
=COUNTIF(H12:H33,">0")

They should both return 22. If they do not, they you probably have one or more entries entered as Text and not Numeric.
 
Last edited:

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,788
maybe:
Code:
=IFERROR(ROUND(AVERAGEIFS(H12:H50,F12:F50,"<"&EDATE(E9,(65*12))),2),0)
complete the formula with the names of the worksheets
 
Last edited:

leopardhawk

Active Member
Joined
May 31, 2007
Messages
356
Office Version
2016
Platform
Windows
Many thanks to Fluff, Joe & Sandy! I found that I had an extra row on my worksheet that was blank and therefore messing up the data! Thanks to all for your assistance!

Cheers!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,206
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

Forum statistics

Threads
1,081,989
Messages
5,362,581
Members
400,683
Latest member
LogChief

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top