excel 공식 생성

1672 단어 Excel


col = ["B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","AA"]

flag = 1
for j in range(0,144,16):
	print "************************************************************" + str(flag)
	flag = flag+1
	strs = "=sum("
	stra = "=B"+str(j+15)+"/sum("
	for i in range(0,9):
		if i==8:
			strs += "IF(AND(C"+str(i+j+4)+">-20,C"+str(i+j+4)+"<20),B"+str(i+j+4)+",0))"
			stra += "IF(AND(C"+str(i+j+4)+">-20,C"+str(i+j+4)+"<20),1,0))"
		else:
			strs += "IF(AND(C"+str(i+j+4)+">-20,C"+str(i+j+4)+"<20),B"+str(i+j+4)+",0),"
			stra += "IF(AND(C"+str(i+j+4)+">-20,C"+str(i+j+4)+"<20),1,0),"
	print strs
	print stra

print "#####################################################################"


flag = 1
for j in range(0,144,16):
	print "*************************************************************************" + str(flag)
	flag = flag+1
	for i in range(0,len(col),3):
		strd = "=IF(AND("+col[i+1]+str(j+4)+">-20,"+col[i+1]+str(j+4)+"<20),"+col[i]+str(j+4)+",$"+col[i]+"$"+str(j+16)+")"
		print strd

좋은 웹페이지 즐겨찾기