May 13 2021 05:40 AM - edited May 15 2021 07:14 AM
Estimada comunidad, gusto en saludarlos y les deseo éxitos en sus funciones / emprendimientos.
Traigo a colación la utilización de la siguiente formula:
=SI.ERROR(SI(TEXTO(FECHA(Calendar_Year;FILA($A1);1);"ddd")=IZQUIERDA(C$5;2);FECHA(Calendar_Year;FILA($A1);1);"");"")
Esta formula esta en una plantilla de excel sobre el registro de asistencia de empleados, su instrucción no esta muy clara, por ello acudo a ustedes, estaré super agradecido si me explican como la debo aplicar, que valor es que debo cambiar.
Atento
May 13 2021 05:48 PM
May 15 2021 07:14 AM
May 15 2021 01:49 PM
May 15 2021 02:46 PM - edited May 15 2021 04:02 PM
SolutionHi @AdminLirios
The formula below will add 2 if the day was Saturday, 1 if the day was Sunday otherwise just return today's date:
=IF(TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())),"ddd")="Sat",DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))+2,IF(TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())),"ddd")="Sun",DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))+1,DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))))
Your Formula:
ERROR(SI(
TEXT(
DATE(Calendar_Year; FILA($A 1);1);
" ddd")-LEFT(C$5;2); DATE(Calendar_Year; FILA($A 1);1);"");"")
Your formula translated:
=IFERROR(TEXT(DATE(Calendar_Year, MONTH(NOW()),,1)," ddd")-LEFT(C$5,2), DATE(Calendar_Year, MONTH(NOW()),1),"")
TEXT(DATE(Calendar_Year,Month(NOW()),1)," ddd") RETURNS A = Sat LEFT(C5,2) RETURNS A = DO
your formula is stating Sat minus Do at this point in your formula
TEXT(DATE(Calendar_Year,Month(NOW()),1)," ddd")-LEFT(C$5,2) RETURNS A = #VALUE!
as soon as your formula subtracts Sat from Do it starts to error out
I'm not really sure what FILA($A 1)statement in your formula is, but since it is inside the DATE Function: DATE(YEAR(),MONTH(),1)
I'm going to assume its trying to get some kind of a month for a value
I am going to assume that your date formula is trying to do a date math to skip domingo because the work week never includes a Sunday, is this a correct assumption?
May 16 2021 12:45 PM
That is well known Microsoft template, I'd don't modify the formulas in it without strong need. The only it's language specific. If formula doesn't detect first date of the month that most probably means in your locale and in template short names of week days are different.
May 17 2021 04:15 AM
May 17 2021 04:21 AM - edited May 17 2021 05:30 AM
Looking at your workbook, in the calendar it only has days of the week i.e. Lunes, martes, miércoles, jueves y viernes, but no actual date, so how do you detect if a tree is tall or short without other trees around? (just throwing some humor into the convo)
May 17 2021 09:53 AM
Sorry, I don't know how it shall be in Spanish version. In English version it is used 3 letters for weekday and formula compares 3 characters.
May 17 2021 03:54 PM - edited May 17 2021 05:22 PM
Hi @AdminLirios
Here's how far I got to for the answer to that question:
The other Lookup Tables:
So you're just going to map out the first weeks of the month, and the formula will be:
=IF(C$4=$J6,1,IF(AND(ISNUMBER(B6),B6>=1),B6+1,""))
May 17 2021 05:27 PM
Hi @AdminLirios
Here is the workbook with the Tools, Mapping and a Test Calendar to apply the mapping
cheers
May 18 2021 03:11 AM
I'd return back initial formulas as in original templates
for the first 7 days
=IFERROR(IF(LEFT(TEXT(DATE(Calendar_Year,ROW($A1),1),"[$-es-ES]ddd"),2)=LEFT(C$5,2),DATE(Calendar_Year,ROW($A1),1),IF(B6>=1,B6+1,"")),"")
in between
=IFERROR(IF(I6>=1,I6+1,""),"")
for last 7 days
=IFERROR(IF(AND(AK6>=1,AK6+1<=DATE(Calendar_Year,ROW($A1)+1,0)),AK6+1,""),"")
When it shows correctly off-days
and summary
May 18 2021 02:42 PM
I was merely trying to answer the question:
so what would be the value I should modify to detect the first week, because I write in the cells
indicated there and it does not return any results to me!!
and that was the answer to the question asserted above, and not to advise whether or not to use the template as is. I was assuming the user had other operations or procedures that cannot be accomplished by using a constant date. I hope that my response answered the question above.
May 18 2021 03:44 PM
Formula didn't work since template assumed Spanish which was not exactly the same as local on user machine. For example, in Spanish-Spain =TEXT(date,"ddd") returns weekday as "DO.", Spanish-Chile "DOM.", etc. and template assumes it shall be "DO"
If correct this like =LEFT(TEXT(date,"ddd"),2) template works fine, that was the only issue with it. With this small correction template automatically detects first week.
Perhaps better to download template localized for exactly this language or we may play with locale on PC, with that initial template shall work from the box.
Sorry, I know no one word in Spanish and have no idea which exactly Spanish is required.
May 18 2021 06:28 PM
All Spanish based days are the same:
so what would be the value I should modify to detect the first week
May 19 2021 10:52 AM
Spanish - yes, maybe. I only know that for different Spanish locales Excel returns different texts, e.g.
As for template itself - yes, that could be done by different ways. However, this template is known for several years and used by many people in different countries, without need it's better not to change the logic of formulas used in this template.
May 15 2021 02:46 PM - edited May 15 2021 04:02 PM
SolutionHi @AdminLirios
The formula below will add 2 if the day was Saturday, 1 if the day was Sunday otherwise just return today's date:
=IF(TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())),"ddd")="Sat",DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))+2,IF(TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())),"ddd")="Sun",DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))+1,DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))))
Your Formula:
ERROR(SI(
TEXT(
DATE(Calendar_Year; FILA($A 1);1);
" ddd")-LEFT(C$5;2); DATE(Calendar_Year; FILA($A 1);1);"");"")
Your formula translated:
=IFERROR(TEXT(DATE(Calendar_Year, MONTH(NOW()),,1)," ddd")-LEFT(C$5,2), DATE(Calendar_Year, MONTH(NOW()),1),"")
TEXT(DATE(Calendar_Year,Month(NOW()),1)," ddd") RETURNS A = Sat LEFT(C5,2) RETURNS A = DO
your formula is stating Sat minus Do at this point in your formula
TEXT(DATE(Calendar_Year,Month(NOW()),1)," ddd")-LEFT(C$5,2) RETURNS A = #VALUE!
as soon as your formula subtracts Sat from Do it starts to error out
I'm not really sure what FILA($A 1)statement in your formula is, but since it is inside the DATE Function: DATE(YEAR(),MONTH(),1)
I'm going to assume its trying to get some kind of a month for a value
I am going to assume that your date formula is trying to do a date math to skip domingo because the work week never includes a Sunday, is this a correct assumption?