{"id":3851,"date":"2017-04-13T16:30:58","date_gmt":"2017-04-13T14:30:58","guid":{"rendered":"https:\/\/www.sheetgo.com\/?p=3851"},"modified":"2017-04-13T16:30:58","modified_gmt":"2017-04-13T14:30:58","slug":"formule-daverage-google-sheets","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/fr\/blog\/google-sheets-formulas\/daverage-formula-google-sheets\/","title":{"rendered":"Comment utiliser la formule DAVERAGE dans Google Sheets ?"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; module_class=&#8221;sheetgo-post&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>The<span>\u00a0<\/span><a href=\"https:\/\/support.google.com\/docs\/answer\/3094144?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">DAVERAGE<\/a><span>\u00a0<\/span>formula in Google Sheets is almost similar to that of the<span>\u00a0<\/span><a href=\"https:\/\/support.google.com\/docs\/answer\/3093615?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">AVERAGE<\/a>formula, but with a distinction. It gives us the average of values available in a table like range, that meet a specified criteria. This is analogous to an SQL database sum query. The \u2018D\u2019 in the DAVERAGE stands for \u2018Database\u2019, therefore, we can call this a Database AVERAGE formula.<\/p>\n<h3>Syntax<\/h3>\n<p><strong><span>DAVERAGE(database, field, criteria)<\/span><\/strong><\/p>\n<ul>\n<li><span><strong>database<\/strong><\/span><span>\u00a0<\/span>\u2013 is the reference to a structured data range that consists of labels, for each column, in the first row.<\/li>\n<li><span><strong>field<\/strong><\/span><span>\u00a0<\/span>\u2013 indicates the column on which the DAVERAGE formula should average the numeric values. This can be a text or a column index too.<\/li>\n<li><span><strong>criteria<\/strong><\/span><span>\u00a0<\/span>\u2013 this is a reference to a range that consists of criteria that the formula uses to filter the database values before averaging.<\/li>\n<\/ul>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h3>Usage: DAVERAGE Formula<\/h3>\n<p>Let us assume that the below list of foods is our secret diet suggested by a nutritionist. We will try our hands with a few examples.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/10\/DAVERAGE-formula-1.png&#8221; alt=&#8221;DAVERAGE formula 1&#8243; title_text=&#8221;DAVERAGE formula 1&#8243; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>We see that the data set is in a labeled tabular form spanning across cells A4 through to G13. And the criteria is keyed in the cells A1 through to G2.<\/p>\n<p>Please note from the cases illustrated above that we can specify one or more criteria to filter the averaging process. For example, the case in row # 7 averages the values in the \u201cCarbs (g)\u201d column, subject to the criteria in the cell D2. Whereas the case in row # 10 averages the values from \u201cFat (g)\u201d column, subject to the criteria within the cells C2 and D2. The case on row # 11 includes all the criteria from A2 through to G2.<\/p>\n<p>The case in row # 12 is a rather interesting one! We didn\u2019t specify anything in the cell G2, yet, we gave that reference to the DAVERAGE formula. The result is 4.50 because it averaged everything in the \u201cFiber (g)\u201d column as there are no criteria to filter out the rows.<\/p>\n<h5>Unwarranted Case<\/h5>\n<p>Now, let us talk about a pitfall. Here is the first one, which we might already be aware of. Please consider the first case in the snapshot below.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/10\/DAVERAGE-formula-2.png&#8221; alt=&#8221;DAVERAGE formula 2&#8243; title_text=&#8221;DAVERAGE formula 2&#8243; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Here, we tried averaging non-numeric values! Just like the<span>\u00a0<\/span><a href=\"https:\/\/support.google.com\/docs\/answer\/3093615?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">AVERAGE<\/a><span>\u00a0<\/span>formula, DAVERAGE formula averages only numbers. Otherwise, it returns #DIV\/0! error.<\/p>\n<p>Here\u2019s the second one in the image below.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2021\/10\/DAVERAGE-formula-3.png&#8221; alt=&#8221;DAVERAGE formula 3&#8243; title_text=&#8221;DAVERAGE formula 3&#8243; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><span>Seemingly there\u2019s nothing wrong with the formula this time but the result isn\u2019t what we are expecting. The problem lies within the labels though. Apparently, a missing or a mismatched label doesn\u2019t help the DAVERAGE formula, as its working hinges on the field name that the second parameter takes. The labels didn\u2019t match, so it evaluates zero instances of a criteria match, which implies a divide by zero occurrences, hence the error.<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The\u00a0DAVERAGE\u00a0formula in Google Sheets is almost similar to that of the\u00a0AVERAGEformula, but with a distinction. It gives us the average of values available in a table like range, that meet a specified criteria. This is analogous to an SQL database sum query. The \u2018D\u2019 in the DAVERAGE stands for \u2018Database\u2019, therefore, we can call this [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":4010,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"The <a href=\"https:\/\/support.google.com\/docs\/answer\/3094144?hl=en\" target=\"_blank\" rel=\"noopener\">DAVERAGE<\/a> formula in Google Sheets is almost similar to that of the <a href=\"https:\/\/support.google.com\/docs\/answer\/3093615?hl=en\" target=\"_blank\" rel=\"noopener\">AVERAGE<\/a> formula, but with a distinction. It gives us the average of values available in a table like range, that meet a specified criteria. This is analogous to an SQL database sum query. The \u2018D\u2019 in the DAVERAGE stands for \u2018Database\u2019, therefore, we can call this a Database AVERAGE formula.\n<h3>Syntax<\/h3>\n<strong><span style=\"font-family: courier new,courier,monospace; font-size: 14pt;\">DAVERAGE(database, field, criteria)<\/span><\/strong>\n<ul>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>database<\/strong><\/span> \u2013 is the reference to a structured data range that consists of labels, for each column, in the first row.<\/li>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>field<\/strong><\/span> \u2013 indicates the column on which the DAVERAGE formula should average the numeric values. This can be a text or a column index too.<\/li>\n \t<li><span style=\"font-family: courier new,courier,monospace; font-size: 12pt;\"><strong>criteria<\/strong><\/span> \u2013 this is a reference to a range that consists of criteria that the formula uses to filter the database values before averaging.<\/li>\n<\/ul>\n<h3>Usage: DAVERAGE Formula<\/h3>\nLet us assume that the below list of foods is our secret diet suggested by a nutritionist. We will try our hands with a few examples.\n\n<img class=\"aligncenter size-full wp-image-3852\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-49.png\" alt=\"DAVERAGE Formula - Illustration 1\" width=\"1255\" height=\"360\" \/>\n\nWe see that the data set is in a labeled tabular form spanning across cells A4 through to G13. And the criteria is keyed in the cells A1 through to G2.\n\nPlease note from the cases illustrated above that we can specify one or more criteria to filter the averaging process. For example, the case in the row # 7 averages the values in the \u201cCarbs (g)\u201d column, subject to the criteria in the cell D2. Whereas the case in row # 10 averages the values from \u201cFat (g)\u201d column, subject to the criteria within the cells C2 and D2. The case on row # 11 includes all the criteria from A2 through to G2.\n\nThe case on the row # 12 is a rather interesting one! We didn\u2019t specify anything in the cell G2, yet, we gave that reference to the DAVERAGE formula. The result is 4.50 because it averaged everything in the \u201cFiber (g)\u201d column as there are no criteria to filter out the rows.\n<h5>Unwarranted Case<\/h5>\nNow, let us talk about a pitfall. Here is the first one, which we might already be aware of. Please consider the first case in the snapshot below.\n\n<img class=\"aligncenter size-full wp-image-3857\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-50.png\" alt=\"DAVERAGE Formula - Illustration 2\" width=\"1237\" height=\"361\" \/>\n\nHere, we tried averaging non-numeric values! Just like the <a href=\"https:\/\/support.google.com\/docs\/answer\/3093615?hl=en\" target=\"_blank\" rel=\"noopener\">AVERAGE<\/a> formula, DAVERAGE formula averages only numbers. Otherwise, it returns #DIV\/0! error.\n\nHere\u2019s the second one in the image below.\n\n<img class=\"aligncenter size-full wp-image-3854\" src=\"https:\/\/static.sheetgo.com\/wp-content\/uploads\/2017\/10\/frame-generic-51.png\" alt=\"DAVERAGE Formula - Illustration 3\" width=\"1237\" height=\"363\" \/>\n\nSeemingly there\u2019s nothing wrong with the formula this time but the result isn\u2019t what we are expecting. The problem lies within the labels though. Apparently, a missing or a mismatched label doesn\u2019t help the DAVERAGE formula, as its working hinges on the field name that the second parameter takes. The labels didn\u2019t match, so it evaluates zero instances of a criteria match, which implies a divide by zero occurrences, hence the error.\n\n&nbsp;","_et_gb_content_width":"","footnotes":""},"categories":[54],"tags":[39,28],"class_list":["post-3851","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-sheets-formulas","tag-connections-t","tag-spreadsheets"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/posts\/3851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/comments?post=3851"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/posts\/3851\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/media\/4010"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/media?parent=3851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/categories?post=3851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/tags?post=3851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}