以文本方式查看主题 - 易表在线答疑 (http://egrid2000.com/dvbbs/index.asp) -- 用户社区 (http://egrid2000.com/dvbbs/list.asp?boardid=2) ---- 请求帮助! (http://egrid2000.com/dvbbs/dispbbs.asp?boardid=2&id=28600) |
-- 作者:laozhou8083 -- 发布时间:2016/5/4 17:37:00 -- 请求帮助! if([员工姓名_员工1]="",0,1)+if([员工姓名_员工2]="",0,1)+if([员工姓名_员工3]="",0,1)+if([员工姓名_员工4]="",0,1)+if([员工姓名_员工5]="",0,1)+if([员工姓名_员工6]="",0,1)+if([员工姓名_员工7]="",0,1),这一组公式,有没有哪个函数或公司可以代替啊? 用于统计当天当组当批量生产时投入的人数。这个公式我只列了一部分,实际上后面到了34个位置。看着太麻烦了! |
-- 作者:dancedy -- 发布时间:2016/5/4 22:07:00 -- 中间数字根据需求增减
Eval("if([员工姓名_员工" + Substitute("1|2|3|4|5|6|7|8|9|10|11|12|13|14|15","|","]="""",0,1) + if([员工姓名_员工") + "]="""",0,1)") |
-- 作者:laozhou8083 -- 发布时间:2016/5/7 17:30:00 -- 非常感谢! |
-- 作者:laozhou8083 -- 发布时间:2016/5/7 18:01:00 -- 大神,能不能帮我解释这个公式的涵义啊?复制您给的公式确实解决了问题! |
-- 作者:laozhou8083 -- 发布时间:2016/5/7 20:34:00 -- 大师,再请教,下面的公式如何简化?能不能再帮帮忙?拜托了! sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工1","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工2","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工3","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工4","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工5","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工6","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工7","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工8","=",GridName)
|
-- 作者:laozhou8083 -- 发布时间:2016/5/8 0:22:00 -- 大师,我将表达式变了一下,模拟您上次帮我做的,将员工姓名的判定条件用IF函数做,然后就和上次的问题类似了。只是中间加入了sumfor函数。我做了之后始终显示为语法错误。公式如下: Eval("If([A拉数据录入表!员工姓名_员工"+Substitute("1|2|3|4|5|6|7|8|9|10","|","]=GridName,"sumfor(""A拉数据录入表"",""人均净工费"",""日期"",""="",[日期])",0)+If([A拉数据录入表!员工姓名_员工")+"]=GridName,"sumfor(""A拉数据录入表"",""人均净工费"",""日期"",""="",[日期])",0)") 后来我怀疑是不是函数嵌套的问题,我就将SUMFOR函数做成一个变量%净工费%,将公式设置如下: Eval("If([A拉数据录入表!员工姓名_员工"+Substitute("1|2|3|4|5|6|7|8|9|10","|","]=GridName,%净工费%,0)+If([A拉数据录入表!员工姓名_员工")+"]=GridName,%净工费%,0)") 这样设置后,易表不提示错误了,但是运算结果却是空。 实在不知道原因出在哪里!求大师指教! 先谢谢了!
|
-- 作者:iyplx2425 -- 发布时间:2016/5/8 8:51:00 -- 授人以鱼,不如授人以渔。5楼公式: sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工1","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工2","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工3","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工4","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工5","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工6","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工7","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工8","=",GridName) 用Eval()来简化,步骤如下。 第一步:简化成以下格式: sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工 1","=",GridName)+sumfor("A拉数据录入表","人均净工费","日期","=",[日期],"员工姓名_员工 …… 8","=",GridName) 红色一段称为头部,蓝色一段为中部,紫色一段为尾部。 Eval()函数公式写法如下 。 第二步:列出函数: Eval("") 第三步:改写头部,规则是用""替代",并写入函数内: Eval("sumfor(""A拉数据录入表"",""人均净工费"",""日期"",""="",[日期],""员工姓名_员工") |
-- 作者:iyplx2425 -- 发布时间:2016/5/8 8:51:00 -- 第四步:在头部末加入替换函数 Substitute(),格式为"+Substitute("","","")+": Eval("sumfor(""A拉数据录入表"",""人均净工费"",""日期"",""="",[日期],""员工姓名_员工"+Substitute("","","")+"") 第五步:填充替换函数公式。第一个双引号中列入变量,此处为1、2……7、8,格式为:1|2|3|4|5|6|7|8;第二个双引号中写入变量分隔符|;第三个双引号中写入前面说的中部,但中部所有"也要改写为"": Eval("sumfor(""A拉数据录入表"",""人均净工费"",""日期"",""="",[日期],""员工姓名_员工"+Substitute("1|2|3|4|5|6|7|8","|",""",""="",GridName)+sumfor(""A拉数据录入表"",""人均净工费"",""日期"",""="",[日期],""员工姓名_员工")+"") 第六步:写入尾部,也是要把所有"也要改写为"": Eval("sumfor(""A拉数据录入表"",""人均净工费"",""日期"",""="",[日期],""员工姓名_员工"+Substitute("1|2|3|4|5|6|7|8","|",""",""="",GridName)+sumfor(""A拉数据录入表"",""人均净工费"",""日期"",""="",[日期],""员工姓名_员工")+""",""="",GridName)") 这样,整个公式就完成了。楼主可以试试看。6楼公式因为没看到文件,对其中一些数据关系不清楚,所以无法回复。 |
-- 作者:laozhou8083 -- 发布时间:2016/5/8 9:14:00 -- 谢谢大师!我先参悟一下,有不理解的再向大师请教! |
-- 作者:iyplx2425 -- 发布时间:2016/5/8 9:18:00 -- 先检验原始公式是否正确(不用写那么多,就一、 两个变量就行),再套用这个方法。 |