Learn Python

Learn Data Structure & Algorithm

Learn Numpy

Learn Pandas

Learn Matplotlib

Learn Seaborn

Learn Statistics

Learn Math

Learn MATLAB

Learn Machine learning

Learn Github

Learn OpenCV

Learn Deep Learning

Learn MySQL

Learn MongoDB

Learn Web scraping

Excel Introduction

Excel Home Tab

Excel Insert Tab

Excel Data Tab

Excel Use of Formula

Excel SUM and SUMIF function

Excel AVRAGE,AVRAGEIF,AVRAGEIFS,MEDIAN,MODE function

Excel COUNT,COUNTA,COUNTBLANK,COUNTIF,COUNTFS Formula

Excel MAX,LARGE,MIN,SMALL,DMAX,DMIN Formula

Excel generate date & time Formula

Excel CONCATENATE,UPPER,LOWER,PROPER Formula

Excel RUNNING TOTOAL,Power,GCD,DATEDIF Formula

Excel ROUND,ROUNDUP,ROUNDDOWN Formula

Excel IF,AND,OR Formula

Excel ARRAY Formula

Excel LOOKUP,VLOOPUP,MATCH,VLOOKUP+MATCH Formula

Excel DSUM,DAVERAGE,FORECAST,EDATE,DCOUNT Formula

Excel ERROR

Learn Power BI

Learn Tableau

Learn Docker

Learn Hadoop

Everything about excel if | or formula

IF, AND, OR, these are logical functions because it gives result based on condition.

How to use IF in excel?

Formula: =IF(Condition,what to do if the condition is true,what to do if the condition is false)

In the IF condition, you have three parts. In the first part, you will write the condition and in the second part, you will write what to do if the condition get matched and in the third part is for what to do if the condition doesn't get matched. A comma is used between these parts.

In the example, you have Customer Id, the total amount. Now you want to give a discount to those customers who buy product 1000 or more than 1000 dollar per month. So here you can use a condition that if a customer buys 1000 or more than 1000 then give a discount if not then sorry.


A B C
Index Customer Id Total amount Discount
1 111 1000 =IF(B1>=1000,B1-5%,"Sorry")
2 221 700
3 4232. 1200
4 544 900
5 63 800
6 7457 1500
7 876 1350
8 916 1050
9 1033 400
10 111 3000
11

Now to apply for other cells just drag it to the end.

OR,AND

Suppose you have two conditions and you want that one condition among these two conditions needs to be fulfilled. In this case use OR for these two conditions, and if you want that both two conditions need to be fulfilled then use AND for these two conditions. You can have more than two conditions but it doesn't matter. You can use how many conditions you want inside AND and OR.

Let's see example for AND
If a customer buys a phone more than 500 dollars and a notebook more than 550 dollars and if their total buying money is more than equal to 1000 dollars then you will give a 10% discount.


A B C D
Index Customer Id Mobile NoteBook Total amount Discount
1 111 300 700 1000 =IF(AND(B1>=500,C1>=550,D1>=1000),C1-10%,"SORYY")
2 221 450 0 450
3 4232. 600 300 900
4 544 700 450 1150
5 63 0 800 800
6 7457 0 550 550
7 876 800 0 800
8 916 100 750 850
9 1033 0 490 490
10 111 1000 0 1000
11

Now to apply for other cells just drag it to the end.

Let's see example for OR
If a customer buys a phone more than 500 dollars or notebook more than 550 dollars or if their total buying money is more than equal to 1000 dollars then you will give a 10% discount.


A B C D
Index Customer Id Mobile NoteBook Total amount Discount
1 111 300 700 1000 =IF(OR(B1>=500,C1>=550,D1>=1000),D1-10%,"SORYY")
2 221 450 0 450
3 4232. 600 300 900
4 544 700 450 1150
5 63 0 500 500
6 7457 0 550 550
7 876 800 0 800
8 916 100 950 1050
9 1033 0 490 490
10 111 1000 0 1000
11

Now to apply for other cells just drag it to the end.

How to use Nested IF?

Nested if means in an IF function you will use multiple If functions. In nested If you start creating conditions from the highest/maximum range move to the lower/minimum range.
Suppose you have ages 10,20,30,40. Now if you want to use nested IF then start giving conditions from 40 and then move to 10.

Formula: =IF(Condition,what to do if condition is true,what to do if condition is false)

In the IF formula, you have three-part. The last part is if false then what to do.

Formula: =IF(Condition,true,IF(condition,True,IF(condition,true,false)))

In nested IF, use another IF condition in the place of the false value of the previous IF condition, and in the end of nested IF condition writes a false value. In the formula, I wrote the second IF condition on that place where you should write the false value of the first IF function. Here third IF condition is written where you should write the second IF condition false value and in the third condition I pass the false value. Now here You wrote 3 conditions. If we have more then you can add more and in the last condition wrote the false value.

In the example, if a customer buys greater than an equal 1000 dollar product then you will give that customer 10% discount, If buy greater than equal 800 then 7% and if greater than 500 then 2% and if less than 500 then no discount.


A B C
Index Customer Id Total amount Discount
1 111 600 =IF(B1>=1000,B1-10%,IF(B1>=800,B1-7%,IF(B1>=500,B1-2%,"SORRY")))
2 221 550
3 4232. 800
4 544 1000
5 63 500
6 7457 550
7 876 3000
8 916 1050
9 1033 1290
10 111 900
11

Now to apply for other cells just drag it to the end.

CodersAim is created for learning and training a self learner to become a professional from beginner. While using CodersAim, you agree to have read and accepted our terms of use, privacy policy, Contact Us

© Copyright All rights reserved www.CodersAim.com. Developed by CodersAim.