EXCEL 公式運算

2015-05-13 6:09 am
當輸入B3公式出現#NAME?其餘都是這樣情況,怎樣解決?謝!

「A7今月到期(e)」下面的四條公式應該是放到B7:E7才對。

鑑於「今月」的定義不一定是真正實時的「今月」,在有「今月」的公式可加入多一條件「下月之前」,如果想查看以前月份(例如2015年2月)也可以:
K2:K5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1)
舉例B7公式修改如下:

B7 =COUNTIFS(工作表 1!F2:F5001,B$2,H2:H5001,LEFT(B$1,4),K2:K5001,">="&DATE($A$1,$A$2,1), K2:K5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

上述公式未試用,因之前公式出現#NAME?,未用到,但不太明白,能否再講講今月?謝!

回答 (1)

2015-05-13 6:30 pm
✔ 最佳答案
原先公式中「工作表1」或「工作表2」部份在「1」或「2」前多了一個空格,所以導致出現#NAME?情況,此外所有公式中凡由第2列至5001列的儲存格範圍前面應該都要加上「工作表1!」或「工作表2!」才對,現修正公式如下:

1. 在工作表1上 M2:O2三道公式:
M2 =LOOKUP(2,1/(工作表2!$A$2:$A$75000=$D2),工作表2!$E$2:$E$75000)
N2 =LOOKUP(2,1/(工作表2!$A$2:$A$75000=$D2),工作表2!$F$2:$F$75000)
O2 =COUNTIF(工作表2!$A$2:$A$75000, $D2)

2. 在工作表 5上累計表公式:
A3上月累積(a) :
B3 =COUNTIFS(工作表1!F2:F5001,B$2,工作表1!H2:H5001,LEFT(B$1,4),工作表1!J2:J5001,"<"&DATE($A$1,$A$2,1))
C3 =COUNTIFS(工作表1!F2:F5001,C$2,工作表1!H2:H5001,LEFT(B$1,4),工作表1!J2:J5001,"<"&DATE($A$1,$A$2,1))
D3 =COUNTIFS(工作表1!F2:F5001,D$2,工作表1!H2:H5001,LEFT(D$1,4),工作表1!J2:J5001,"<"&DATE($A$1,$A$2,1))
E3 =COUNTIFS(工作表1!F2:F5001,E$2,工作表1!H2:H5001,LEFT(D$1,4),工作表1!J2:J5001,"<"&DATE($A$1,$A$2,1))

A4今月新增(b):
B4 =COUNTIFS(工作表1!F2:F5001,B$2,工作表1!H2:H5001,LEFT(B$1,4),工作表1!J2:J5001,">="&DATE($A$1,$A$2,1),工作表1!J2:J5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))
C4 =COUNTIFS(工作表1!F2:F5001,C$2,工作表1!H2:H5001,LEFT(B$1,4),工作表1!J2:J5001,">="&DATE($A$1,$A$2,1),工作表1!J2:J5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))
D4 =COUNTIFS(工作表1!F2:F5001,D$2,工作表1!H2:H5001,LEFT(D$1,4),工作表1!J2:J5001,">="&DATE($A$1,$A$2,1),工作表1!J2:J5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))
E4 =COUNTIFS(工作表1!F2:F5001,E$2,工作表1!H2:H5001,LEFT(D$1,4),工作表1!J2:J5001,">="&DATE($A$1,$A$2,1),工作表1!J2:J5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

A5今月續會(c):
B5 =COUNTIFS(工作表1!F2:F5001,B$2,工作表1!H2:H5001,LEFT(B$1,4),工作表1!M2:M5001,">="&DATE($A$1,$A$2,1),工作表1!M2:M5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))
C5 =COUNTIFS(工作表1!F2:F5001,C$2,工作表1!H2:H5001,LEFT(B$1,4),工作表1!M2:M5001,">="&DATE($A$1,$A$2,1),工作表1!M2:M5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))
D5 =COUNTIFS(工作表1!F2:F5001,D$2,工作表1!H2:H5001,LEFT(D$1,4),工作表1!M2:M5001,">="&DATE($A$1,$A$2,1),工作表1!M2:M5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

2015-05-13 10:31:54 補充:
E5 =COUNTIFS(工作表1!F2:F5001,E$2,工作表1!H2:H5001,LEFT(D$1,4),工作表1!M2:M5001,">="&DATE($A$1,$A$2,1),工作表1!M2:M5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

2015-05-13 10:32:22 補充:
A6今月刪除(d):
B6 =COUNTIFS(工作表1!F2:F5001,B$2,工作表1!H2:H5001,LEFT(B$1,4),工作表1!P2:P5001,">="&DATE($A$1,$A$2,1),工作表1!P2:P5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

2015-05-13 10:32:55 補充:
C6 =COUNTIFS(工作表1!F2:F5001,C$2,工作表1!H2:H5001,LEFT(B$1,4),工作表1!P2:P5001,">="&DATE($A$1,$A$2,1),工作表1!P2:P5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

2015-05-13 10:33:24 補充:
D6 =COUNTIFS(工作表1!F2:F5001,D$2,工作表1!H2:H5001,LEFT(D$1,4),工作表1!P2:P5001,">="&DATE($A$1,$A$2,1),工作表1!P2:P5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

2015-05-13 10:33:38 補充:
E6 =COUNTIFS(工作表1!F2:F5001,E$2,工作表1!H2:H5001,LEFT(D$1,4),工作表1!P2:P5001,">="&DATE($A$1,$A$2,1),工作表1!P2:P5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

2015-05-13 10:34:04 補充:
A7今月到期(e):
B7 =COUNTIFS(工作表1!F2:F5001,B$2,工作表1!H2:H5001,LEFT(B$1,4),工作表1!K2:K5001,">="&DATE($A$1,$A$2,1),工作表1!K2:K5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

2015-05-13 10:34:33 補充:
C7 =COUNTIFS(工作表1!F2:F5001,C$2,工作表1!H2:H5001,LEFT(B$1,4),工作表1!K2:K5001,">="&DATE($A$1,$A$2,1),工作表1!K2:K5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

2015-05-13 10:34:54 補充:
D7 =COUNTIFS(工作表1!F2:F5001,D$2,工作表1!H2:H5001,LEFT(D$1,4),工作表1!K2:K5001,">="&DATE($A$1,$A$2,1),工作表1!K2:K5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))

2015-05-13 10:35:00 補充:
E7 =COUNTIFS(工作表1!F2:F5001,E$2,工作表1!H2:H5001,LEFT(D$1,4),工作表1!K2:K5001,">="&DATE($A$1,$A$2,1),工作表1!K2:K5001,"<"&DATE(if($A$2=12,$A$1+1, $A$1),if($A$2=12,1,$A$2+1),1))


收錄日期: 2021-04-11 21:08:33
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20150512000051KK00068

檢視 Wayback Machine 備份