Write Excel formula into cell

Hi,

i want to write into an excel cell AF2 a formula, but i get the exception “The range does not exist”.

The formula should calculate the date, by giving the calendar week in cell AF3.
image

Does anybody know why i get this exception? How can i solve this?

Greetings :smiley:

1 Like

Do you have a sheet name “update

Regards,
Karthik Byggari

1 Like

Hi @mcLauge

Try to use the below formula, it is working for me

“=DATE((YEAR(NOW())), 1,1) - WEEKDAY(DATE((YEAR(NOW ())), 1,1),2)+AF3*7”

BEST REGARDS
AJAY

Fine what you have written in value is correct
And. The only thing we need to check is
— kindly close the excel before processing we might be getting this error due to that
— or even if the error persists try to uninstall and reinstall the excel package and try
This would work for sure
You were almost done
Cheers @mcLauge

2 Likes

Thanks for your help, but even if i try out your recommendation , it still isn´t working.

Any other ideas how i can make this work?

Best regards

@Palaniyappan
image

even if i save the value of cell AF3 as a GenericValue, it doesn´t work. I still get the same error occurring.

@Ajju Thanks, it works now perfectly!

@Palaniyappan @Ajju @KarthikByggari does anybody know how to convert or format the result cell from my formula into a date format? i tried to overwrite it with this , but it doesn´t work.

image

Greetings and thanks for ur help! :smiley:

Use the excel function:TEXT(), not the Uipath method.

=TEXT(DATE((YEAR(NOW())),1,1)-WEEKDAY(DATE((YEAR(NOW())),1,1),2)+AF3*7,“dd.MM.yyyy”)

Result:

@knight.star
for me it doesn´t work. this is my result:

i copied the line that you wrote into my code but it gives me this my outcome.

fix the ["] of “dd.MM.yyyy” in your excel.
don’t copy the formula, the “” became wrong when i copied from excel to the forum.

@mcLauge use below Expression

DateVariable = Cdate(Valuefromcell).tostring(“dd.MM.yyyy”)

above expression only works if the input is in MM DD yyyy format otherwise you need to split the value then pass the value in MM DD YYYY format into CDate

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.