在J2单元格输入公式:=IF(I2>=600,优秀,IF(I2>=500,普通,"不优秀")) 说明:此时一共有两个IF函数,里面嵌套了一个,这个语句先判断第一个IF,如果大于等于600,则返回优秀,然后把剩下的小于600的单元格区域丢给第二个IF函数判断,因为此时这里面都是小于600分的单元格了,所以只需要在判断条件处写大于等于500...
在J2单元格输入公式:=IF(I2>=600,优秀,IF(I2>=500,普通,"不优秀")) 说明:此时一共有两个IF函数,里面嵌套了一个,这个语句先判断第一个IF,如果大于等于600,则返回优秀,然后把剩下的小于600的单元格区域丢给第二个IF函数判断,因为此时这里面都是小于600分的单元格了,所以只需要在判断条件处写大于等于500...
在对非连续范围使用COUNTIF函数之前,让我们先了解什么是非连续范围。非连续范围由工作表中的多个独立范围组成,例如下图所示的范围B5:B12、D5:D13和F7:F11。 要统计这个非连续范围中大于80的单元格数量,请应用以下公式。 通用公式 =SUM(COUNTIF(INDIRECT({"rng1","rng2","rng3"}),条件)) 参数 Rng1:非连...
MATCH( value, array, [match_type] ) searches for a value in an array and returns the relative position of that item. match_type =0,will find the first value that is equal tovalue. 本例中,先通过match函数查找SH002在工号列中出现的位置,再通过Index函数去匹配姓名列对应的数值。 参考资料 IF...
True and False Results: In this example if a range contains a specific value the VBA code will return a value of "In Range". If a range does not contain a specific value the VBA code will return a value of "Not in Range". Both of these values can be changed to whatever value you...
For Each x In sum_range If x.Interior.ColorIndex = ref_rang.Interior.ColorIndex Then SumColor = Application.Sum(x) + SumColor End If Next x End Function (3)返回工作表即可用函数SUMCOLOR进行求和了。 附上代码解析: 注意:使用了宏表函数,以及VBA自定义函数后,文件需要保存为支持宏的xlsm格式。
计数公式:=COUNTIF(C2:C18,6)三、使用vba自定义函数 1.根据颜色求和代码 Dim icell As Range Application.Volatile For Each icell In sumrange If icell.Interior.ColorIndex = col.Interior.ColorIndex Then SumColor = Application.Sum(icell) + SumColor End If Next icell 2.根据颜色计数代码 Application...
=IF(logical_test, [value_if_true], [value_if_false]) Arguments Explanation: ArgumentCompulsory/OptionalExplanation logical_test Compulsory Given condition for a cell or a range of cells. [value_if_true] Optional Defined statement if the condition is met. [value_if_false] Optional Defined sta...
一、excelCountIf函数语法 1、表达式:COUNTIF(Range, Criteria) 中文表达式:COUNTIF(统计区域, 条件) 2、说明: A、Range 可以是数组或单元格的引用。 B、条件可以是单个数字或文本,也可以为表达式或函数;但条件中不能超过 255 个字符,否则会返回错误;如果条件超过 255 个字符,可以把它们拆分为多个长字符串,然后...
While working on excel with lots of data, sometimes you want to check if a certain value exists in a range of data. This might seem a simple task when your range is small and you can check manually that whether the required value exists in range. But whe