excel - If a cell contains any of these values, then label as this -


i want set formula in excel if column b (which contains dates) contains of dates in list of 7 dates, labeled "week 1", if not, it'll labeled "week 2". formula listed below returning #name error. thoughts?

ie: =if((b1,containsany=j1:j7), "week 1", "week 2")

pic: http://i57.tinypic.com/2vlk4g5.png

as per screenshot, can date's week using weeknum function. example, assuming dates start @ row 10, place formula in cell i10 , copy cells below, , week number.

=weeknum(b10,15)-36

the second parameter defines when week starts (15 = friday in case), , week 37th of year, subtract 36. :)

with approach, don't need hardcode dates in cells j1:k7, , it's future-proof. ;)


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -