简体   繁体   English

如何在 excel 表中使用 IF 编写多个条件?

[英]How to write multiple conditions using IF in excel sheet?

I am trying to test whether the subject ID tested in an application is classified (ADHD-combined, ADHD-inattentive or healthy) correctly or not.我正在尝试测试应用程序中测试的主题 ID 是否正确分类(ADHD 组合、ADHD 注意力不集中或健康)。 I have a table with identifier names and the decision in percentages.我有一个带有标识符名称和百分比决定的表格。

A一个 B
subject_id主题ID decision决定
NDARAA112DMH NDARAA112DMH 0.55196626 0.55196626
NDARAD615WLJ NDARAD615WLJ 0.58124495 0.58124495
NDARAG143ARJ NDARAG143ARJ 0.65364915 0.65364915

I want to have a table like this after I use the "IF" formula in excel.在我使用 excel 中的“IF”公式后,我想要一个这样的表格。

A一个 B C C
subject_id主题ID decision决定 result结果
NDARAA112DMH NDARAA112DMH 0.55196626 0.55196626 combined结合
NDARAD615WLJ NDARAD615WLJ 0.58124495 0.58124495 inattentive不专心
NDARAG143ARJ NDARAG143ARJ 0.65364915 0.65364915 inattentive不专心

How to write this expression in an excel formula if B2 = 0.55±0.02 then write "combined" if B2 = 0.59 ± 0.09 then write "inattentive" else write "healthy".如何在 excel 公式中写这个表达式 如果 B2 = 0.55±0.02 然后写“组合” 如果 B2 = 0.59 ± 0.09 然后写“不专心” 否则写“健康”。 Any help would be highly appreciated.任何帮助将不胜感激。

=IF(ABS(B2-0.55)<0.02,"combined",IF(ABS(B2-0.59)<0.09,"inattentive","healthy"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM