Funkcia AND v programe Excel (vzorec, príklady) Ako používať funkciu AND v programe Excel

Funkcia AND v programe Excel

Funkcia AND v programe Excel je kategorizovaná ako logická funkcia; vráti iba dve hodnoty, ktoré sú TRUE a FALSE. Toto AND v programe Excel testuje zadanú podmienku a vráti TRUE, ak sú podmienky splnené ako TRUE, inak vráti FALSE. Táto funkcia sa často používa s inými funkciami programu Excel. A v programe Excel môže významne rozšíriť možnosti tohto hárka.

A vzorec v programe Excel

Tento vzorec AND by sa dal napísať aj ako

AND (podmienka1, [podmienka2], ...)

Vysvetlenie funkcie AND v programe Excel

logická 1 je prvá podmienka alebo logická hodnota, ktorá sa má vyhodnotiť

logická 2 je voliteľný argument, je druhou podmienkou alebo logickou hodnotou na vyhodnotenie

V závislosti od situácie a požiadavky môže byť testovaných viac logických výrazov (podmienok).

Funkcia AND v programe Excel vráti TRUE, ak sú všetky podmienky TRUE. Ak je niektorá z podmienok NEPRAVDA, vráti hodnotu FALSE.

Ak všetky logické výrazy vyhodnotia hodnotu TRUE (prvý prípad), funkcia AND v programe Excel vráti hodnotu TRUE a ak je niektorý z logických výrazov vyhodnotený ako FALSE (druhý, tretí a štvrtý prípad), funkcia AND in excel vráti hodnotu FALSE.

Ak sa argument logického výrazu vyhodnotí na čísla, namiesto boolovskej logickej hodnoty TRUE / FALSE sa s nulovou hodnotou zaobchádza ako s FALSE a so všetkou nenulovou hodnotou ako TRUE.

A funkcia v programe Excel sa často používa s funkciami ako IF, OR a ďalšími funkciami.

Ako používať funkciu AND v programe Excel

Funkcia AND v programe Excel je veľmi jednoduchá a ľahko použiteľná. Pochopme fungovanie funkcie AND v programe Excel pomocou príkladov.

Tu si môžete stiahnuť túto šablónu Excel s funkciou AND - Šablóna Excel s funkciou AND

AND v excelovom príklade č. 1

K dispozícii je 10 hráčov a každý musí vyčistiť všetky 3 úrovne, aby bol víťazom. To znamená, že ak hráč vyčistí úroveň 1, úroveň 2 a úroveň 3, bude víťazom, ak nevymažú niektorú z úrovní neuspeje a nebude vyhlásená za víťazku.

Pomocou funkcie AND v programe Excel skontrolujeme, či niektorá z úrovní nie je jasná, či potom nie je víťazom. Aplikovanie vzorca AND v stĺpci E. 

Výkon:

Prehrávač 2 a prehrávač 10 vymazali všetky úrovne, a preto sú všetky logické podmienky TRUE, preto funkcie AND Excel poskytli výstup TRUE a pre zvyšok, ak niektorá úroveň zo všetkých troch nebola vymazaná, logický výraz vyhodnotený ako FALSE a AND v programe Excel vyústil do FALSE výstupu.

AND v Exceli Príklad č. 2

Použitie funkcie AND Excel s funkciou IF

Existuje zoznam študentov s ich percentuálnym podielom a my by sme chceli zistiť známky, kde sú kritériá pre hodnotenie uvedené nižšie v tabuľke:

Ak je percento väčšie ako 90%, potom bude známka A +, keď je percento väčšie alebo rovné 90% a menej ako 80%, potom bude známka A a podobne ostatné známky na základe percenta a študent nevyhovie je percento menšie ako 40%. 

Vzorec, ktorý použijeme, je

= IF (B2> 90, „A +“, IF (AND (B280), „A“, IF (AND (B275), „B +“, IF (AND (B270), „B“, IF (AND (B260) , „C +“, IF (AND (B250), „C“, IF (AND (B240), „D“, „FAIL“)))))))

Na výpočet stupňa študenta sme použili vnorené IF v programe Excel s viacerými funkciami AND excel.

Vzorec IF testuje podmienku a dáva výstup, pre hodnotu podmienky, ak je TRUE else, vráti hodnotu, ak je FALSE.

=if(logical_test, [value_if_TRUE],[value_if_FALSE])

First logical test, in this case, is B2>90, if this is TRUE then Grade is ‘A+’, if this condition is not TRUE if checks for the statement after comma and it again entered another if condition, in which we have to test 2 conditions that is if percentage is greater than 80 and percentage less than or equal to 90 so, logical statements are

B280

Since we have to test two conditions together we have used AND Excel function. So, if B280, is TRUE the Grade will be ‘A’, if this condition is not TRUE IF checks for the statement after the comma and it again enters another IF condition and will continue to check each statement till the last bracket closes. In the last IF statement it checks, percentage 40, hence last IF statement evaluates Grade ‘D’ else evaluate ‘FAIL’.

AND in Excel Example #3

Using AND excel function with IF function

There is a list of employees and the sale amount in Column B, on the basis of their sale amount the incentives are allotted to each employee. Sale incentive criteria are

We need to calculate the incentive of each employee based on his performance for cracking the sale base on the criteria mentioned above in the table

Roman made a sale of $3000, he will receive an incentive amount of $400 and David and Tom were not able to even crack $1000 sale the bare minimum sale criteria for an incentive, hence they will not get any incentive.

Formula that we will use is

=IF(AND(B2>=3000),400,IF(AND(B2>=2000,B2=1500,B2=1000,B2<1500),100,0))))

We have again used Nested IF in excel conditions with multiple AND excel function testing the all the logical conditions together in the formula above to compute the sale incentive of the employee based on the sale amount that he/she made.

David and Tom were not able to meet the incentive criteria hence their incentive amount is $0.

Nesting of AND Function in Excel

Nesting means using the AND in excel as an argument in the function itself. Nesting functions in Excel refer to using one function inside another function. Excel allows you to nest up to 64 levels of functions.

AND in Excel Example #4

There is a list of candidates who appeared for posting in Army for which there are certain selection conditions.

Eligibility Criteria: Age has to be greater than or equal to 18 but less than 35 years with a height greater than 167 cms, eyesight has to be normal and has successfully completed the long run task

Here, we will be using the Nested AND in Excel to check the eligibility criteria.

Formula that we will use is

=AND(B2=”Normal”,C2>167,D2=”Successful”,AND(E2>=18,E2<35))

As, you can see we have, used multiple logical conditions, to check if they evaluate to be TRUE and for age, we have again used AND function in Excel to check if age is greater than or equal to 18 and less than 35 years.

We have used AND function in excel inside AND function to check the age criteria.

Output:

Three candidates passed all the selection criteria, Ralph, Alex and Scott. Hence, their eligibility computes out as TRUE using the AND function in Excel and for rest of the candidates FALSE. 

Limitation of AND Function in Excel

The AND function in Excel can test multiple conditions not exceeding more than 255 conditions. In Excel version 2003, the AND in excel could test up to 30 arguments, but in Excel version 2007 and later it can handle up to 255 arguments.

The AND function in excel returns #Value! Error if logical conditions are passed as a text or string.