{"id":51625,"date":"2024-12-10T14:00:00","date_gmt":"2024-12-10T13:00:00","guid":{"rendered":"https:\/\/blog.sheetgo.com\/?p=51625"},"modified":"2025-06-03T22:11:45","modified_gmt":"2025-06-03T20:11:45","slug":"maitriser-la-formule-de-requete-4-cas-dutilisation","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/fr\/blog\/google-sheets-formulas\/mastering-query-formula-4-use-cases\/","title":{"rendered":"Ma\u00eetriser la formule QUERY : 4 cas d'utilisation avec exemples"},"content":{"rendered":"\n[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_row _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#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.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">The QUERY formula in Google Sheets is a powerful tool for filtering, grouping, and summarizing data. With this formula, you can simplify data management, perform advanced analysis, and create detailed reports.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In this blog, we\u2019ll explore four practical use cases to demonstrate how the QUERY formula can transform your workflows.<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>1. Streamlining inventory management<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Scenario: A warehouse manager needs to retrieve details about oversold products and calculate daily out-of-stock totals from inventory records.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><b>A<\/b><\/p>\n<\/td>\n<td>\n<p><b>B<\/b><\/p>\n<\/td>\n<td>\n<p><b>C<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Product<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Stock<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Sales<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Product A<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">50<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">60<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Product B<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">30<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">15<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Product C<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">10<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">20<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">=QUERY(<\/span><span style=\"font-weight: 400;\">A1:C4<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">&#8220;SELECT A, B, C, (C &#8211; B) WHERE (C &#8211; B) &gt; 0 LABEL (C &#8211; B) &#8216;Oversold by&#8217; &#8220;<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">)<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; sticky_enabled=&#8221;0&#8243;]<p><span style=\"font-weight: 400;\">Breakdown:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Data Range:<\/b><span style=\"font-weight: 400;\"> (A1:C4).<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">The formula processes data from the entire table.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>SELECT clause:<\/b><span style=\"font-weight: 400;\"> SELECT A, B, C, (C &#8211; B).<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Retrieves columns A, B, C, and the difference between sales and stock (C &#8211; B).<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>WHERE clause:<\/b><span style=\"font-weight: 400;\"> (C &#8211; B) &gt; 0.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Filters rows where sales are higher than stock, showing only oversold products.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>LABEL clause:<\/b><span style=\"font-weight: 400;\"> LABEL (C &#8211; B) &#8216;Oversold by&#8217;.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Renames (C &#8211; B) to &#8220;Oversold by&#8221; in the output.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Header indicator: <\/b><span style=\"font-weight: 400;\">(1).<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Treats the first row as headers for proper formatting.<\/span><\/li>\n<\/ul>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">Product<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Stock<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Sales<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Oversold by<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Product A<\/span><\/td>\n<td><span style=\"font-weight: 400;\">50<\/span><\/td>\n<td><span style=\"font-weight: 400;\">60<\/span><\/td>\n<td><span style=\"font-weight: 400;\">10<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Product C<\/span><\/td>\n<td><span style=\"font-weight: 400;\">10<\/span><\/td>\n<td><span style=\"font-weight: 400;\">20<\/span><\/td>\n<td><span style=\"font-weight: 400;\">10<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1vQ4-2rH8jjbNLN5Gu6UdHi0hFXPxs70L_Y2VOyvLjKQ\/copy\" target=\"_blank\" rel=\"noopener\"><i><span style=\"font-weight: 400;\">Copy the spreadsheet to check out the formula<\/span><\/i><\/a><\/p>\n<h2><\/h2>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>How it works<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The QUERY formula selects products where sales exceed stock, automatically calculating the oversold amount.<\/span><\/p>\n<h3><b>Benefits<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Identify oversold products in seconds.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Eliminate manual filtering and calculation errors.<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>2. Summarizing Financial Data by Category<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Scenario: A finance team needs to analyze expenses by category for daily and monthly reporting.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><b>A<\/b><\/p>\n<\/td>\n<td>\n<p><b>B<\/b><\/p>\n<\/td>\n<td>\n<p><b>C<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Date<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Category<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Expense ($)<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">01\/01\/2024<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Marketing<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">200<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">01\/01\/2024<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Travel<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">300<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">02\/01\/2024<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Marketing<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">150<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">=QUERY(<\/span><span style=\"font-weight: 400;\">A1:C5<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">&#8220;SELECT B, SUM(C) WHERE B IS NOT NULL GROUP BY B LABEL SUM(C) &#8216;Total Expense ($)'&#8221;<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">)<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; sticky_enabled=&#8221;0&#8243;]<p><span style=\"font-weight: 400;\">Breakdown<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Data Range: <\/b><span style=\"font-weight: 400;\">(A1:C5).<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">The formula processes data from columns A, B, and C in this range.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>SELECT clause<\/b><span style=\"font-weight: 400;\">: SELECT B, SUM(C).<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Retrieves column B (Category) and calculates the sum of column C (Expense).<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>WHERE clause<\/b><span style=\"font-weight: 400;\">:WHERE B IS NOT NULL.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Excludes rows where column <\/span><span style=\"font-weight: 400;\">B<\/span><span style=\"font-weight: 400;\"> (Category) is blank.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>GROUP clause:<\/b><span style=\"font-weight: 400;\"> GROUP BY B LABEL SUM(C)<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Groups the data by category (<\/span><span style=\"font-weight: 400;\">B<\/span><span style=\"font-weight: 400;\">) to calculate totals for each unique category.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>LABEL clause: <\/b><span style=\"font-weight: 400;\">LABEL SUM(C) &#8216;Total Expense ($)&#8217;.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Renames the calculated total (<\/span><span style=\"font-weight: 400;\">SUM(C)<\/span><span style=\"font-weight: 400;\">) to &#8220;Total Expense ($)&#8221; for clarity.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Header indicator: <\/b><span style=\"font-weight: 400;\">1.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Treats the first row as headers for proper formatting.<\/span><\/li>\n<\/ul>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">Category<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Total Expense ($)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Marketing<\/span><\/td>\n<td><span style=\"font-weight: 400;\">350<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Travel<\/span><\/td>\n<td><span style=\"font-weight: 400;\">300<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1vQ4-2rH8jjbNLN5Gu6UdHi0hFXPxs70L_Y2VOyvLjKQ\/copy\" target=\"_blank\" rel=\"noopener\"><i><span style=\"font-weight: 400;\">Copy the spreadsheet to check out the formula<\/span><\/i><\/a><\/p>\n<h2><\/h2>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>How it works<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The QUERY formula groups expenses by category and calculates their total.<\/span><\/p>\n<h3><b>Benefits<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Gain insights into spending patterns.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Quickly prepare data for financial analysis or presentations.<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; sticky_enabled=&#8221;0&#8243;]<p><span style=\"font-weight: 400;\">Breakdown<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Data Range: <\/b><span style=\"font-weight: 400;\">(A1:C5).<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">The formula processes data from columns A, B, and C in this range.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>SELECT clause<\/b><span style=\"font-weight: 400;\">: SELECT B, SUM(C).<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Retrieves column B (Category) and calculates the sum of column C (Expense).<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>WHERE clause<\/b><span style=\"font-weight: 400;\">:WHERE B IS NOT NULL.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Excludes rows where column <\/span><span style=\"font-weight: 400;\">B<\/span><span style=\"font-weight: 400;\"> (Category) is blank.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>GROUP clause:<\/b><span style=\"font-weight: 400;\"> GROUP BY B LABEL SUM(C)<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Groups the data by category (<\/span><span style=\"font-weight: 400;\">B<\/span><span style=\"font-weight: 400;\">) to calculate totals for each unique category.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>LABEL clause: <\/b><span style=\"font-weight: 400;\">LABEL SUM(C) &#8216;Total Expense ($)&#8217;.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Renames the calculated total (<\/span><span style=\"font-weight: 400;\">SUM(C)<\/span><span style=\"font-weight: 400;\">) to &#8220;Total Expense ($)&#8221; for clarity.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Header indicator: <\/b><span style=\"font-weight: 400;\">1.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Treats the first row as headers for proper formatting.<\/span><\/li>\n<\/ul>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">Category<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Total Expense ($)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Marketing<\/span><\/td>\n<td><span style=\"font-weight: 400;\">350<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Travel<\/span><\/td>\n<td><span style=\"font-weight: 400;\">300<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1vQ4-2rH8jjbNLN5Gu6UdHi0hFXPxs70L_Y2VOyvLjKQ\/copy\" target=\"_blank\" rel=\"noopener\"><i><span style=\"font-weight: 400;\">Copy the spreadsheet to check out the formula<\/span><\/i><\/a><\/p>\n<h2><\/h2>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>3. Tracking Stock Movement<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Scenario: A store manager wants to monitor stock added and sold per product over a week.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><b>A<\/b><\/p>\n<\/td>\n<td>\n<p><b>B<\/b><\/p>\n<\/td>\n<td>\n<p><b>C<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Product<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Date<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Stock ($)<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Product A<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">01\/01\/2024<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">10<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Product A<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">02\/01\/2024<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">20<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Product B<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">01\/01\/2024<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">5<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\n<\/h2>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">=QUERY(<\/span><span style=\"font-weight: 400;\">A1:C6<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">&#8220;SELECT A, SUM(C) WHERE A IS NOT NULL GROUP BY A LABEL SUM(C) &#8216;Total Stock Added ($)&#8217; &#8220;<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">)<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; sticky_enabled=&#8221;0&#8243;]<p><span style=\"font-weight: 400;\">Breakdown:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Data Range:<\/b><span style=\"font-weight: 400;\"> (A1:C6).<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">The formula processes data from columns A, B, and C in this range.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>SELECT clause<\/b><span style=\"font-weight: 400;\">: SELECT A, SUM(C).<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Retrieves column <\/span><span style=\"font-weight: 400;\">A<\/span><span style=\"font-weight: 400;\"> (Product Name) and the sum of column <\/span><span style=\"font-weight: 400;\">C<\/span><span style=\"font-weight: 400;\"> (Stock Added).<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>WHERE clause<\/b><span style=\"font-weight: 400;\">: WHERE A IS NOT NULL.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Excludes rows where column <\/span><span style=\"font-weight: 400;\">A<\/span><span style=\"font-weight: 400;\"> (Product Name) is blank.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>GROUP clause: <\/b><span style=\"font-weight: 400;\">GROUP BY A.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Groups the data by product (<\/span><span style=\"font-weight: 400;\">A<\/span><span style=\"font-weight: 400;\">) to calculate totals for each unique product.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>LABEL clause: <\/b><span style=\"font-weight: 400;\">LABEL SUM(C) &#8216;Total Stock Added ($)&#8217;.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Renames the calculated total (<\/span><span style=\"font-weight: 400;\">SUM(C)<\/span><span style=\"font-weight: 400;\">) to &#8220;Total Stock Added ($)&#8221; for clarity.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Header indicator: <\/b><span style=\"font-weight: 400;\">1.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Treats the first row as headers for proper formatting.<\/span><\/li>\n<\/ul>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">Product<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Total Stock Added ($)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Product A<\/span><\/td>\n<td><span style=\"font-weight: 400;\">30<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Product B<\/span><\/td>\n<td><span style=\"font-weight: 400;\">5<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1vQ4-2rH8jjbNLN5Gu6UdHi0hFXPxs70L_Y2VOyvLjKQ\/copy\" target=\"_blank\" rel=\"noopener\"><i><span style=\"font-weight: 400;\">Copy the spreadsheet to check out the formula<\/span><\/i><\/a><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>How it works<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The QUERY formula groups stock entries by product and calculates the total.<\/span><\/p>\n<h3><b>Benefits<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Summarize stock trends dynamically.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Simplify stock reconciliation tasks.<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>4. Creating Detailed Timesheet Reports<\/b><\/h2>\n<p><b>Scenario:<\/b><span style=\"font-weight: 400;\"> An HR team needs to generate reports of employee hours by project and week.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><b>A<\/b><\/p>\n<\/td>\n<td>\n<p><b>B<\/b><\/p>\n<\/td>\n<td>\n<p><b>C<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Employee<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Project<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Hours ($)<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Alice<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Project X<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">10<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Bob<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Project Y<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">15<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><span style=\"font-weight: 400;\">Alice<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">Project Y<\/span><\/p>\n<\/td>\n<td>\n<p><span style=\"font-weight: 400;\">20<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">=QUERY(<\/span><span style=\"font-weight: 400;\">A1:C5<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">&#8220;SELECT B, SUM(C) WHERE B IS NOT NULL GROUP BY B LABEL SUM(C) &#8216;Total Hours'&#8221;<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">)<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; sticky_enabled=&#8221;0&#8243;]<p><span style=\"font-weight: 400;\">Breakdown<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Data Range:<\/b><span style=\"font-weight: 400;\"> A1:C5.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Processes data from columns A, B, and C in this range.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>SELECT clause<\/b><span style=\"font-weight: 400;\">: SELECT B, SUM(C).<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Retrieves column <\/span><span style=\"font-weight: 400;\">B<\/span><span style=\"font-weight: 400;\"> (Project Name) and calculates the sum of column <\/span><span style=\"font-weight: 400;\">C<\/span><span style=\"font-weight: 400;\"> (Hours Worked).<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>WHERE clause<\/b><span style=\"font-weight: 400;\">: WHERE B IS NOT NULL.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Excludes rows where column <\/span><span style=\"font-weight: 400;\">B<\/span><span style=\"font-weight: 400;\"> (Project Name) is blank.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>GROUP clause: <\/b><span style=\"font-weight: 400;\">GROUP BY B.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Groups the data by project (<\/span><span style=\"font-weight: 400;\">B<\/span><span style=\"font-weight: 400;\">) to calculate totals for each unique project.<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>LABEL clause: <\/b><span style=\"font-weight: 400;\">LABEL SUM(C) &#8216;Total Hours&#8217;.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Renames the calculated total (<\/span><span style=\"font-weight: 400;\">SUM(C)<\/span><span style=\"font-weight: 400;\">) to &#8220;Total Hours&#8221; for clarity<\/span><\/li>\n<\/ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Header indicator: <\/b><span style=\"font-weight: 400;\">1.<\/span><\/li>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Treats the first row as headers for proper formatting.<\/span><\/li>\n<\/ul>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">Project<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Total Hours<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Project X<\/span><\/td>\n<td><span style=\"font-weight: 400;\">10<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Project Y<\/span><\/td>\n<td><span style=\"font-weight: 400;\">35<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1vQ4-2rH8jjbNLN5Gu6UdHi0hFXPxs70L_Y2VOyvLjKQ\/copy\" target=\"_blank\" rel=\"noopener\"><i><span style=\"font-weight: 400;\">Copy the spreadsheet to check out the formula<\/span><\/i><\/a><\/p>\n<h2><\/h2>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><span style=\"font-weight: 400;\">How it works<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The QUERY formula groups hours by project and calculates their total, offering a detailed view of time allocation.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Benefits<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Automate timesheet summaries.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Minimize manual reporting errors.<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h1><b>Unlock the Power of QUERY Formulas<\/b><\/h1>\n<p><span style=\"font-weight: 400;\">The QUERY formula is a must-have tool for anyone working with data in Google Sheets. Its ability to filter, group, and summarize data dynamically simplifies workflows and unlocks powerful insights.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Have a unique use case for the QUERY formula? Share it in the comments\u2014we\u2019d love to hear how you\u2019re using this versatile tool!<\/span><\/p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]\n","protected":false},"excerpt":{"rendered":"<p>The QUERY formula in Google Sheets is a powerful tool for filtering, grouping, and summarizing data. With this formula, you can simplify data management, perform advanced analysis, and create detailed reports. In this blog, we\u2019ll explore four practical use cases to demonstrate how the QUERY formula can transform your workflows.1. Streamlining inventory management Scenario: A [&hellip;]<\/p>\n","protected":false},"author":46,"featured_media":44470,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[54],"tags":[],"class_list":["post-51625","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-sheets-formulas"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/posts\/51625","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\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/comments?post=51625"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/posts\/51625\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/media\/44470"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/media?parent=51625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/categories?post=51625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/fr\/wp-json\/wp\/v2\/tags?post=51625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}