COUNTUNIQUEIFS FunctionCounts the number of cells with unique content that match a given criterion entered in the function. This function only exists in Google Sheets.COUNTUNIQUEIFS Function Syntax=COUNTUNIQUEIFS(count_range; range1; criterion1; [range2; criterion2;...])Where the range to count is the range of cells that are the target, and the criterion is a logical test (greater than something or less than something).ExampleSalespersonRegionSales1South879252North1298873Southeast129084South990875Northeast2349876North100007South1050008Midwest18760989Northeast1238710South1287611Southeast12386512Midwest12854313North9870001. How many regions of Brazil are in the table?2. How many regions of Brazil are in the table and are not from the South or Southeast?Solution1. =COUNTUNIQUE(B2:B14 )2. =COUNTUNIQUEIFS(B2:B14; B2:B14;"<>South"; B2:B14;"<>Southeast" )How to do it in Excel?In Excel, we can use two functions to try to produce the same effect:=COUNTA(UNIQUE(B2:B14))COUNTA will count the number of cells with values, and the UNIQUE function will return an array with all the unique values that exist where you selected. To answer the second question, it becomes even more difficult; we would have to add yet another layer of function such as FILTER. That is why I do not recommend Excel for answering this type of question. For example:=COUNTA(UNIQUE(FILTER(B2:B14;(B2:B14<>"South")*(B2:B14<>"Southeast"))))AVERAGEIF or MEDIASE FunctionThe AVERAGEIF function is the integration of the AVERAGE function with the IF function. Use the AVERAGEIF function to average the values in a range that meet the criteria you specify.AVERAGEIF Function Syntax=AVERAGEIF( source_range; criterion; average_range)Where source_range and average_range are lists of values and criterion is an expression.ExampleNameAgeSalaryRenato251500Eduardo231800Cristina361200Bárbara381750Vera221900Evandro241600Fátima312100Carolina271990Eloisa3013001. What is the average salary for those over 30 years old?2. What is the average salary for those under 30 years old?Solution1. =AVERAGEIF( B4:B10;">30"; C2:C10) = R$ 1,683.332. =AVERAGEIF( B4:B10;"<30"; C2:C10) = R$ 1,681.67AVERAGEIFS or MEDIASES FunctionThe AVERAGEIFS function, one of the math and trigonometry functions, adds all its arguments that meet multiple criteria.AVERAGEIFS Function Syntax=AVERAGEIFS( average_range; criteria_range1; criterion1; [criteria_range2; criterion2]; ... )ExampleTypePriceCityBedroomsGarageCozy Apartment230000Areeiro3NoHoliday Bungalow197000Bela Vista2YesVilla345678Bela Vista4YesDuplex321900Areeiro2YesMansion450000Bela Vista5YesColonial Mansion395000Bela vista4No1. What is the average price of a house in Belavista with three or more bedrooms and a garage?2. What is the average price of a house in Areeiro with three or fewer bedrooms and no garage?Solution=AVERAGEIFS(B2:B7 ; C2:C7 ; "=Belavista" ; D2:D7 ; ">2"; E2:E7 ; "=Yes") = R$ 397,839.00=AVERAGEIFS(B2:B7 ; C2:C7 ; "=Areeiro" ; D2:D7 ; "<4"; E2:E7 ; "=No") = R$ 230,000.00ExercisesAccess here the spreadsheet that will be used for the next exercises1. What is the average of the grades above 6?2. How many different grades can be seen?3. What is the average grade for students who missed more than 2 times? And how many different grades can be seen for students who missed more than 2 times?4. And the average grade for students who did not miss the first two classes? And how many different grades can be seen for students who did not miss the first two classes?Use the following table for the next exercises:OrderCustomerDishAmount (R$)Payment MethodCity101JoãoPizza50.00CardSão Paulo102MariaHamburger30.00CashRio de Janeiro103CarlosSushi80.00CardBelo Horizonte104AnaPizza55.00PixCuritiba105RobertoHamburger32.00CashSão Paulo106FernandaSushi85.00CardSão Paulo107RicardoPizza52.00PixBelo Horizonte108CamilaHamburger35.00CardCuritiba109LuizSushi90.00CashRio de Janeiro5. How many different cities have registered orders?6. How many customers paid with Pix or Cash?7. What is the average amount of orders paid by Card?8. What is the average amount of Pizza or Sushi orders made in São Paulo?Use the following table for the next exercises:CodeProductCategoryStockPrice (R$)SupplierP001NotebookElectronics123500.00Tech StoreP002SmartphoneElectronics202500.00DigitalShopP003PrinterOffice8800.00Office ProP004DeskFurniture51200.00MoveisPlusP005ChairFurniture10600.00MoveisPlusP006TV 55"Electronics152800.00DigitalShopP007KeyboardAccessories30200.00Tech StoreP008MouseAccessories25150.00Tech StoreP009MonitorOffice7900.00Office Pro9. How many different product categories exist in stock?10. What is the average price of products in the Electronics category?11. How many products have stock below 10 units?12. What is the average price of products supplied by MoveisPlus?
— コメント 0
, 反応 1
最初にコメントする