Reputation: 11
I have the following code:
=UPPER(TEXT(DATE(K2;K1;1+14) + CHOOSE(WEEKDAY(DATE(K2;K1;1)); 1;0;6;5;4;3;2);" \s\e\m\a\n\a d \d\e mmmm \d\e aaaa"))
Which displays:
SEMANA DE 15 DE SETEMBRO DE 2014
But I need to display:
SEMANA DE **15-21** DE SETEMBRO DE 2014
What am I missing?
Upvotes: 1
Views: 243
Reputation: 46331
This is an alternative approach you could try - should get you the same result
="SEMANA "&22-WEEKDAY(DATE(K2;K1;6))&"-"&28-WEEKDAY(DATE(K2;K1;6))&" DE "&UPPER(TEXT(K1*29;"mmmm"))&" DE "&K2
Upvotes: 1
Reputation: 61860
=SUBSTITUTE(UPPER(TEXT(DATE(K2;K1;1+14) + CHOOSE(WEEKDAY(DATE(K2;K1;1)); 1;0;6;5;4;3;2);" \s\e\m\a\n\a d-""$EOW$"" \d\e mmmm \d\e aaaa"));"$EOW$";DAY(DATE(K2;K1;1+14) + CHOOSE(WEEKDAY(DATE(K2;K1;1)); 1;0;6;5;4;3;2))+6)
I have assumed, that you calculate the first Monday after the 15th of the month and want to show this day and 6 days after. The idea is to substitute "$EOW$" in the format-string with the day+6.
Upvotes: 2