Skip to content

Instantly share code, notes, and snippets.

@Shinichi-Ohki
Created January 28, 2014 05:29
Show Gist options
  • Save Shinichi-Ohki/8662707 to your computer and use it in GitHub Desktop.
Save Shinichi-Ohki/8662707 to your computer and use it in GitHub Desktop.
B列に入ってる曜日が月〜金でC列になにか記入されているセルを数える式と、土日祝で(略)を出力するRubyスクリプト
# coding: utf-8
1.upto(31){|num|
if num==1
print("=")
else
print("+")
end
print("and(or($B$%d=\"月\",$B$%d=\"火\",$B$%d=\"水\",$B$%d=\"木\",$B$%d=\"金\"),C$%d<>\"\")"%[num+1,num+1,num+1,num+1,num+1,num+1])
# )
}
print("\n")
1.upto(31){|num|
if num==1
print("=")
else
print("+")
end
print("and(or($B$%d=\"土\",$B$%d=\"日\",$B$%d=\"祝\"),C$%d<>\"\")"%[num+1,num+1,num+1,num+1])
# )
}
print("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment