以工作中遇到的试题上传为例:试题中标注色块的选项为正确答案。
目的:将正确答案汇总
操作步骤:
一、定义名称:选择有背景色块的表格,“公式”—“定义名称”,命名:颜色1;引用位置:=GET.CELL(38,$C2)+NOW()*0
*在单元格代码C2的前面加上美元符号“$”,是保证在调用此定义公式时,不会错乱。
二、获取颜色代码:在空格中输入“=颜色1”
四、要想判断D2单元格是否有色块,可在空列输入“=IF(颜色1=43,"A","")”
五、同理,定义颜色2,颜色3,颜色4。则题目的正确答案为:“=IF(颜色1=43,"1","")&IF(颜色2=43,"2","")&IF(颜色3=43,"3","")&IF(颜色4=43,"4","")”
六、如在答案需用逗号“,”隔开,则在代码中稍作变动:“=IF(颜色1=43,"A","")&IF(颜色2=43,",B","")&IF(颜色3=43,",C","")&IF(颜色4=43,",D","")”
*注意:这样得出的答案中会有首个字符是“,”,如“,2”、“,3,4”的答案,还需去掉首个字符