COUNTIF FunctionCounts the number of cells that match a specific criterion placed in the function.Syntax of the COUNTIF function=COUNTIF(range_to_count; criterion)Where 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). The types of tests that exist:CriterionOperatorExampleGreater than>=COUNTIF(A2:A10; ">5")Less than<=COUNTIF(A2:A10; "<10")Equal to=(can be omitted)=COUNTIF(A2:A10; "="&D1)or=COUNTIF(A2:A10,D1)Not equal to<>=COUNTIF(A2:A10; "<>"&D1)Greater than or equal to>==COUNTIF(A2:A10; ">=5")Less than or equal to<==COUNTIF(A2:A10; "<=10")Example1. Count the number of cells with apples in the cells2. Count the number of cells with a value greater than 553. Count the number of cells with apples or orangesFruitsQuantityApples32Oranges54Peaches75apples86Solution1. =COUNTIF(A2:A5 ; "=apples")2. =COUNTIF(B2:B5;">55")2. =COUNTIF(A2:A5 ; "=apples") + COUNTIF(A2:A5 ; "=oranges")COUNTIFS FunctionThe COUNTIFS function applies criteria to cells across multiple ranges and counts the number of times all criteria are met.Syntax of the COUNTIFS function=COUNTIFS(range_to_count; criterion; [range_to_count2 ; criterion2; ... ])Example1. How many salespeople exceeded their quotas in Q1 and Q2?2. Did Andrade exceed all sales quotas?SalespersonQ1 Quota ExceededQ2 Quota ExceededQ3 Quota ExceededAndradeYesNoNoBarrosYesYesYesGonçalvesYesYesYesNunoNoYesYesSolution1. =COUNTIFS( B2:B5 ; "=Yes"; C2:C5 ; "=Yes")2. =COUNTIFS(A2:A5 ; "=Andrade"; B2:B5 ; "=Yes"; C2:C5 ; "=Yes"; D2:D5 ; "=Yes"; )SUMIF FunctionThe SUMIF function is the integration of the SUM function with the IF function. Use the SUMIF function to add the values in a range that meet the criteria you specify.Syntax of the SUMIF function=SUMIF( source_range; criterion; sum_range)Where source_range and sum_range are lists of values and criterion is an expression.ExampleVehicleSale ValueCommissionMont1000007000Baster20000014000Nistrade30000021000Keinar40000028000Show the sum of the total commissions whose sale exceeded R$160,000.00.Solution=SUMIF(B4:B7;">160000"; C4:C8)SUMIFS FunctionThe SUMIFS function, one of the math and trigonometry functions, adds all its arguments that meet multiple criteria.Syntax of the SUMIFS function=SUMIFS( sum_range; criteria_range1; criterion1; [criteria_range2; criterion2]; ... )ExampleQuantity SoldProductSeller5ApplesDiogo4ApplesSara15ArtichokesDiogo3ArtichokesSara22BananasDiogo12BananasSara10CarrotsDiogo33CarrotsSaraHow many bananas did Diogo sell? How many other types of products did Diogo sell?Solution=SUMIFS(A2:A9 ; B2:B9 ; "=Bananas" ; C2:C9 ; "=Diogo")=SUMIFS( A2:A9 ; B2:B9 ; "<>Bananas" ; C2:C9 ; "=Diogo")Special CharactersWildcards (* and ?) work only with text. For numbers, use comparators (>, <, etc.). Excel is not case-sensitive in COUNTIF.CharacterNameWhat it doesUsage exampleExpected resultAsteriskRepresents any sequence of characters"Ana"Ana, Anabela, Anaconda?Question markRepresents a single character"A?a"Ana, Aba, AxaTilde (escape)Allows searching for or ? literally""Finds text with *<>Not equal toExcludes a specific value"<>Ana"Everything except Ana=Equal to (optional)Explicit equality"=Ana"Only AnaNameAnaAnabelaBrunoCarlosAna ClaraAmandaJoãoAxaAba1) Count names that start with "Ana"=COUNTIF(A1:A9;"Ana*")2) Count names with exactly 3 letters starting with A=COUNTIF(A1:A9;"A??")3) Count names that are NOT Ana=COUNTIF(A1:A9;"<>Ana")4) Count names that contain "an" in any position=COUNTIF(A1:A9;"an")Exercises1. You would like to sum the paid invoices. So you have a spreadsheet where in column A you put the customer’s name, in column B the invoice amount, and in column C the status, whether it was paid or not.CustomerAmountStatusAndréia150PGCarlos250Patrícia180PGKate350Joana250PGEduardo190PGSum only the invoices that have already been paid.Access here the spreadsheet that will be used for the next exercises2. For each class, 2 periods are counted for a teacher. So, if a teacher gives 10 classes, they have a workload of 20 periods. How many periods does teacher Marta give?3. How many class periods does teacher Calazans give to class 3C?4. Ideally, a teacher gives several classes in a row in one day, thus spending less on transportation and wasting less time going to and from work. Divide teacher Josélia’s week by class periods. Is there any day of the week we should pay attention to?5. How many periods did Girão give per class?6. How many teachers are there in the spreadsheet (UNIQUE)?Access here the spreadsheet that will be used for the next exercises7. Create a "Gross Profit" column and calculate the total expected Gross Profit8. Calculate the Total Gross Profit actually paid9. Calculate the Gross Profit generated by the customer "Renata Tv Max"10. How many times do customers that start with "Mar" appear?
— Комментарии 0
, Реакции 1
Прокомментируйте первым