10837 10874 10874 0
如何在Excel中將IF函數與AND，OR和NOT一起使用？
在Excel中，IF函數對於檢查單元格是否滿足條件並根據評估結果（True和False）返回不同的值非常有用。 並將IF函數與AND，OR，NOT函數結合使用，將改變檢查單元格的條件。 在這裡，我將介紹如何使用IF和AND函數，IF和OR函數以及如何在Excel中組合多個IF函數。
假設我們有一個銷售表，如下面的屏幕截圖所示，現在我們要評估銷售價值並將其分組為“非凡“”低“”中間“和”高".
現在，將行標題和列標題複製到一個空白區域（在我們的示例中為範圍A16：E28），如以下屏幕截圖所示。
如何在Excel中使用IF函數
Excel中IF函數的基本形式如下所示： = IF（邏輯測試，value_if為true，value_if_false）
在我們的情況下，我們要檢查銷售量是否低。 如果單元格B2中的值等於或小於80，則返回文本“低”；如果單元格B2中的值大於80，則返回空白。
輸入公式 = IF（B2 <= 80，“低”，“”） 到單元格B17中，然後將“填充手柄”拖動到範圍B17：E28。 請參閱以下屏幕截圖：
輕鬆地將多個工作表/工作簿/ CSV文件組合到一個工作表/工作簿中
將來自不同工作簿的數十張表合併為一張表可能很麻煩。 但是使用Kutools for Excel的 合併（工作表和工作簿） 實用程序，只需單擊幾下就可以完成！
全功能30天免費試用！
如何在Excel中使用If函數和AND函數
如果要同時檢查一個單元格是否滿足多個條件，可以在Excel中組合IF函數和AND函數。
Excel中AND函數的基本形式是 = AND（邏輯1，邏輯2，邏輯3，…等）
現在，在我們的案例中，我們要同時檢查一個銷售量是否大於80而小於160，如果是，則返回“中間”文本，如果否，則返回空白。
輸入公式 = IF（AND（B2> 80，B2 <160），“ Middle”，“”） 進入單元格B17，然後將“填充手柄”拖動到範圍B17：E28。 請參閱以下屏幕截圖：
如何在Excel中使用IF函數和OR函數
如果要檢查單元格是否滿足多個條件之一，可以在Excel中組合IF函數和OR函數。
Excel中OR功能的基本形式是 = OR（邏輯1，邏輯2，邏輯3，等等）
在我們的示例中，我們要查找大於180或小於20的非常規銷售量。如果銷售量是非常規的，則返回文本“非常規”，如果沒有返回空白。
輸入公式 = IF（OR（B2> 180，B2 <20），“非凡”，“”） 進入單元格B17，然後將“填充手柄”拖動到範圍B17：E28。 請參閱以下屏幕截圖：
如何在Excel中將多個IF函數合併為一個公式
在我們的示例中，如果要使用一個公式評估所有銷量，則可以應用複雜的IF函數。
如果銷售量等於或小於20，則返回文本“非常規”； 如果銷售量等於或小於80，則返回文本“低”； 如果等於或小於160，則返回文本“中”；如果等於或小於200，則返回文本“高”。
輸入公式 = IF（B2 <= 20，“非凡”，IF（B2 <= 80，“低”，IF（B2 <= 160，“中”，IF（B2 <= 200，“高”，“”）））） ） 進入單元格B17，然後將“填充手柄”拖動到範圍B17：E28。 請參閱以下屏幕截圖：
公式太難記了嗎？ 將公式另存為“自動文本”條目，以供日後再次使用！ 閱讀全文... 免費試用 
最佳辦公效率工具
Kutools for Excel解決了您的大多數問題，並使您的生產率提高了80％
 重用: 快速插入 複雜的公式，圖表 以及您以前使用過的任何東西； 加密單元 帶密碼 創建郵件列表 並發送電子郵件...
 超級公式欄 （輕鬆編輯多行文本和公式）； 閱讀版式 （輕鬆讀取和編輯大量單元格）； 粘貼到過濾範圍...
 合併單元格/行/列 不會丟失數據； 拆分單元格內容； 合併重複的行/列...防止細胞重複； 比較範圍...
 選擇重複或唯一 行; 選擇空白行 （所有單元格都是空的）； 超級查找和模糊查找 在許多工作簿中； 隨機選擇...
 確切的副本 多個單元格，無需更改公式參考； 自動創建參考 到多張紙； 插入項目符號，複選框等...
 提取文字，添加文本，按位置刪除， 刪除空間; 創建和打印分頁小計； 在單元格內容和註釋之間轉換...
 超級濾鏡 （將過濾方案保存並應用於其他工作表）； 高級排序 按月/週/日，頻率及更多； 特殊過濾器 用粗體，斜體...
 結合工作簿和工作表; 根據關鍵列合併表； 將數據分割成多個工作表; 批量轉換xls，xlsx和PDF...
 超過300種強大功能。 支持Office / Excel 20072019和365。支持所有語言。 在您的企業或組織中輕鬆部署。 完整功能30天免費試用。 60天退款保證。
Office選項卡為Office帶來了選項卡式界面，使您的工作更加輕鬆
 在Word，Excel，PowerPoint中啟用選項卡式編輯和閱讀，發布者，Access，Visio和Project。
 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
 每天將您的工作效率提高50％，並減少數百次鼠標單擊！
You are guest
or post as a guest, but your post won't be published automatically.

To post as a guest, your comment is unpublished.· 2 months agoI need help to make a formulaQuantity Count 1 Count 2 Count 3
10837 10874 10874 0If count =0, make count 2Quantity, if is <> 0, make count 3Quantity, and if count2 and count 3 =0, make count 1Quantity 
To post as a guest, your comment is unpublished.I need help combining these IF formula:
IF D7<>C$1 "OOP", "Current"
IF D7=C$1 and S7=0, T7>0, "No Rev"
IF D7=C$1 and S7<0, T7> 0, "Loss"
IF D7=C$1 and S7<0, R=0, "No Cost"
IF D7=C$1 and X7<=30%, "High GP"
IF D7C$1 and X7>=5%, "Low GP" 
To post as a guest, your comment is unpublished.Guys, could you please help me with this logic:
=IF fr2=31 (FT4>30,18000,FR4*FQ4) and IF fr2=30 (FT4>29,18000,FR4*FQ4)
i want to combine this.
plz reply early. 
To post as a guest, your comment is unpublished.Hi there, I need this to return the value in the column B6:B28, when either an H or an S are in the boxes I6:I28, works fine without the OR and just H, but not with the OR function, can you possibly help?=IF(AF8=I5,TEXTJOIN(",",FALSE,IF(OR(I6:I28="H",I6:I28="S"),B6:B28,"")))
Many thanks
David 
To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.8. To be a Bunk Leader, a staff member must have over 4 service years and have completed leadership training.
In cell L2, enter a formula using the IF and AND functions, as well as structured references to determine if Adam Moriarty can be a bunk leader.
a. The logical test in the IF function should determine if the staff member’s Service Years is greater than 4 AND the staff member’s Leadership Training status is “Yes”. Remember to use a structured reference to the Service Years and the Leadership Training columns.
b. The function should return the text Yes if a staff member meets both of those criteria.
c. The function should return the text No if a staff member meets none or only one of those criteria. 
To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.hello!
I need your brilliant minds to resolve a problem:
if a1=blank & b1=blank & c1=blank & d1=blank then result1
if a1=blank & b1=blank & c1=blank & d1>0 then result2
if a1=blank & b1=blank & c1>0 & d1>0 then result3
if a1=blank & b1>0 & c1>0 & d1>0 then result4
if a1>0 & b1>0 & c1>0 & d1>0 then result5
Can you please help me with a formula?
i've tried with if/and, if/or but it seams i can't get a result.
Thanks in advance! 
To post as a guest, your comment is unpublished.@amosih@gmail.com Hi Ahmed,
Supposing the first data in Cell A1, and the second data in Cell A2, you can apply the formula as =IF(A1="",IF(A2="","NO DATA", A2),A1) 
To post as a guest, your comment is unpublished.Need some help with logic. I wanted to check the first cell for data if it has data then it will return that cell; if it doesn't have data then it will return a different cell. But if the second cell is blank then it should return a msg. Can you please help.

To post as a guest, your comment is unpublished.IF(D15>30,"Organic Soils",IF(AND(D15>25,D15<29.99),"Clayey Soil (fine)",IF(AND(D15>20,D15<24.99),"Loamy Soil (moderately fine)",IF(AND(D15>10,D15<19.99),"Loamy Soil (medium)",IF(AND(D15>5,D15<9.99),"Loamy Soil (moderately coarse)",IF(D15<4.99,"Sandy Soil (coarse)")))))) Can you find the error?

To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.Name Amount Profit Range
A 10,000
B 50,000
C 42,500
D 75,000
E 85,000
F 23,500
G 16,000
I 57,000
J 81,000
Profit Range Name
Less than 10,000 A
10,00020,000 B
20,00030,000 C
30,000050,000 D
50,000075,000 E
75,0001,00,000 F
Write profit range in 1st table.
any Please say how to write formula for this 
To post as a guest, your comment is unpublished.i required how to steel calculation as per dia (8,10,12,16,20,25,32) and cutting length no of bars and numbers etc
wise in excel format 
To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.Hello all,
I am trying to build an IF statement to help with our Service Level calculations. We need one Queue Name to have a different time requirement than all of the other queues. I am trying to figure out how to get the formula to count all Queue Names (Column B) to show they are within our Service Level Agreement (SLA) if they are in the queue for less than 30 seconds. However, for the Queue named TS_DX_CP_ES*, I need it to show it is within SLA if less than 90 seconds.
I currently have the following formula in place and it works for the 90 second rule but if I try to next the IF formula and change the Queue Name and Time Requirement, I get an error.
Formula that works currently =IF(AND([@[Queue Name]]="TS_DX_CP_ES*",[@[Queue time]]<0.00104166666666667),1,0)
Formula that gives a #VALUE! Error  =IF(AND([@[Queue Name]]="TS_DX_CP_ES*",[@[Queue time]]<0.00104166666666667),1,0),IF(AND([@[Queue Name]]="TS_PLU_US*",[@[Queue time]]<0.000358796296296296),1,0) 
To post as a guest, your comment is unpublished.Hello all,
I am trying to build an IF statement to help with our Service Level calculations. We need one Queue Name to have a different time requirement than all of the other queues. I am trying to figure out how to get the formula to count all Queue Names (Column B) to show they are within our Service Level Agreement (SLA) if they are in the queue for less than 30 seconds. However, for the Queue named TS_DX_CP_ES*, I need it to show it is within SLA if less than 90 seconds.
I currently have the following formula in place and it works for the 90 second rule but if I try to next the IF formula and change the Queue Name and Time Requirement, I get an error.
Formula that works currently =IF(AND([@[Queue Name]]="TS_DX_CP_ES*",[@[Queue time]]<0.00104166666666667),1,0)
Formula that gives a #VALUE! Error  =IF(AND([@[Queue Name]]="TS_DX_CP_ES*",[@[Queue time]]<0.00104166666666667),1,0),IF(AND([@[Queue Name]]="TS_PLU_US*",[@[Queue time]]<0.000358796296296296),1,0)
Any advice or help? 
To post as a guest, your comment is unpublished.@Pinaki Bhattacharyya Hi Pinaki,
In your formula, If A3 > 0, both B3 and C3 also might be greater than 0. Similarly, when B3 > 0, both A3 and C3 also might be greater than 0.
Normally, in the If function, you can set =IF(A3>0, "Welcome",””), which means when A3>0, returns “welcome”, while when A3 is not less than 0, returns nothing. In this function, the two condition A3>0 and A3<=0 are exclusive.
In my example =IF(B2<=20,"Unordinary",IF(B2<=80, "Low", IF(B2<=160, "Middle", IF(B2<=200, "High", "")))), The third condition B3<=160 includes the second condition B2<=80, and the second contains the first too. 
To post as a guest, your comment is unpublished.Hi,
I have a problem. Please help me.
In a row, 3 columns with different value must show a different interpretation in the target cell.
=IF(A3>0,"Welcome",IF(B3>0,"Win",IF(C3>0,"Will","HI")))
Thanks Pinaki 
To post as a guest, your comment is unpublished.@Cab Hi Cab,
To know more about the IF function, I guess this webpage is helpful.
https://support.office.com/enus/article/IFfunction69aed7c94e8a4755a9bcaa8bbff73be2 
To post as a guest, your comment is unpublished.Column A has Numerical Values. Column C & D have text.
If 2 or more separate Numerical Values in any row of Column A match then evaluate those Rows in Column C & D for any Text that doesn't match a given Text and count as 1. If Text does match then a value of 0 is assigned.
So if..
A1:A2 = 1
A3:A4 = 2
C1=Dog
C2=Cat
C3=Dog
C4: Horse
D1=Cat
D2=Dog
D3=Horse
D4=Dog
Since A1 & A2 match each other, evaluate C1,C2,D1,D2 and if any cells do not match either "Dog" or "Cat" assign a value of 1. In this example, since all cells contain either "Dog" or "Cat" a value of 0 would be assigned.
Furthermore,
Since A3 & A4 match each other, evaluate C3,C4,D3,D4 and if any cells do not match either "Dog" or "Cat" assign a value of 1. In this example, since cells C4 & D3 contain something other than "Dog" or "Cat" a value of 1 would be assigned.
Thank you in advance! 
To post as a guest, your comment is unpublished.@MUHAMMAD HARIS Hi Haris,
Could you send a screenshot about your problem? 
To post as a guest, your comment is unpublished.@jessjess Hi jessjess,
Thank you for your comment. I am sorry I can’t figure out a proper formula to meeting your conditions. To know more about the IF function, I guess this webpage is helpful.
https://support.office.com/enus/article/IFfunction69aed7c94e8a4755a9bcaa8bbff73be2 
To post as a guest, your comment is unpublished.Hello,
What would the equation for the following be?
In cell K2 enter a formula using the IF and OR functions, as well as structured references, to determine if Adam Moriarty can be a group leader.
a. The IF function should first determine if the staff member’s Service Years is greater than 3 OR if the staff member’s college graduate status is “Yes”. Remember to use a structured reference to the Service Years and the College Graduate columns.
b. The function should return the text Yes if a staff member meets one or both of those criteria.
c. The function should return the text No if a staff member meets neither of those criteria. 
To post as a guest, your comment is unpublished.i wanna know one thing that i make a table of username and password in excel and there is a third part of them is status i wanna know that if i use a formula in a third column of status using multiple "if " and "or" for the column username where i can use both of them username or phone no then i entered password and it gives in a column of status login if username or phoneno one of them is used with password if someone enter symbols in username status failed. if someone can answer me this is for email validation in excel thanks if answered

To post as a guest, your comment is unpublished.@G =IF(AND(D26="",E26=""),(C26L7),IF(AND(D26<>"",E26=""),D26L7,E26L7))

To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.@Michelle Hi Michelle,
Loading a screenshot can help us understand your problem and need much easier! 
To post as a guest, your comment is unpublished.I am trying to write a formula to look at
1. Is the figure either over £1000, or under £1000
2. Plus is the next cell over 55% or more
so far I have =OR(M4>=1000,M4<=1000) which pulls in the over or under £1000 plus or minus but am unsure how to add the second criteria presume its an AND(N2>=55%) but when I add it to the formula it doesnt work. 
To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.@kelly.extendoffice@gmail.com Hi Kelly!
I actually figured out a workaround!
=ROUND((IFERROR((IF(OR(AND($I9="BOTTOMS",BL9>=$BY$3),AND($I9="TOPS",BL9>=$BY$4)),BL9,VLOOKUP($I9,$BX$3:$BY$4,2,FALSE))),0)),0)
I9  populates "BOTTOMS" or "TOPS" dependant on merchandise code entered
BL9  minimum set defined by store indice
BY9  minimum set defined by buyer (i.e the 14 units for bottom and and the 5 units for tops)
BX$3:$BY$4  vlookup to minimum set defined by buyer if if statement is false 
To post as a guest, your comment is unpublished.@FG87 Hi FG，
You can’t create a formula to meeting one of both your conditions in Excel. 
To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.Hello! I am currently creating a template that will provide me a value depending on the score of the trainee.
I was hoping I can add a value of 5 for any team member who gets a certain quiz %
Here's what I'm thinking.
5= 100%
4= 99.9% to 90%
3= 90% to 85%
2= 85% to 80%
1= <79.99
I hope you guys can help me with the formula 
To post as a guest, your comment is unpublished.@Dan Hi Dan,
Your question is still unclear. you might to explain more by providing a solution for at least 2 companies. However, just help to shorten your OR function a bit. OR(C2={"10","15","20","30"}&" Year Term"). 
To post as a guest, your comment is unpublished.@LINCY =IF(OR(I2=T2+U2,I2=U2+V2),"CLOSED","OPEN")

To post as a guest, your comment is unpublished.@Dan Kinnefer Try this: =IF(OR(H16=0,H16=""),"A",IF(H16=8,"R",IF(H16<7.9,"L","OT")))

To post as a guest, your comment is unpublished.Hello, I have a pretty complex formula I am trying to write and it is killing me to admit defeat on this one. So far I have:
=IF(AND(B2="Prudential",OR(C2={"10 Year Term","15 Year Term","20 Year Term","30 Year Term"})),D2*0.75,(IF(C2="UL",D2*0.8,"0")))
and it works just fine. However, I need to add about 37 more companies with their own commission structures to it. I am pretty sure I just need one monster OR statement with a bunch of nested IFs thrown in I just am at my wits end on figuring out exactly where to place them. Any help would be amazing. Thank you! 
To post as a guest, your comment is unpublished.

To post as a guest, your comment is unpublished.@Mirko Tipka Hi Mirko,
Thank you for your comment. What calculation result do you want to get? Could you tell me more about your problem? 
To post as a guest, your comment is unpublished.Im trying to do IF(OR(A1=1;AND(A2=1;A3=1)))

To post as a guest, your comment is unpublished.@pramod Hi pramod,
You cannot use I2>30<=45 in formula directly. I have changed the formula for you: =IF(I2<=30,"FUTURE PAYMENT",IF(B2<=45, "3045 DAYS", IF(B2<=45, "4560DAYS", IF(B2<=60, "60+DAYS", "")))) 
To post as a guest, your comment is unpublished.@Dan Kinnefer Hi Dan,
Try this formula =IF(H16=8,"R",IF(H16<7.9,"OT","L")) 
To post as a guest, your comment is unpublished.I'm trying to make the formula return 4 possible answer which is (Rregular,Aabsent,Llate,OTovertime). My basis for regular is if the value of the cell is "8". So this is the formula that I made so far =IF(H16>7.9,"OT",IF(H16<7.9,"L",IF(H16=8,"R","A"))). It only returns (OT and L) something is very wrong and i can't figure it out. I'm just new to excel so please help me

To post as a guest, your comment is unpublished.I'm trying to make the formula return 4 possible answer which is (Rregular,Aabsent,Llate,OTovertime). My basis for regular is if the value of the cell is "8". So this is the formula that I made so far =IF(H16>7.9,"OT",IF(H16<7.9,"L",IF(H16=8,"R","A"))). It only returns (OT and L) something is very wrong and i can't figure it out. I'm just new to excel so please help me.

To post as a guest, your comment is unpublished.