1 to Yes and 0 to No in Excel

Hello Team,
I am working in an excel file and need to change 3 rows.
1 to Yes and 0 to No.

Please help

1 Like

@SAHIL_PANDITA
Hello,
Please provide some examples.
Show the excel file with current date and where you need to type this yes/no?

could you give some sample excel for this

hey
use for each row loop
inside loop if use condition like row(“yourColumnName”).ToString.Contains(“Yes”)
then row(“yourColumnName”) = 1
same to No

Hii Veselin,

PFA,

I need to copy the full column B & D “Employee” & “Reserve” and paste in the column F and G but want to replace “Yes” from 1 and “No” from 0.

image

Hii Pradeep,

Can you share one example for this because I’m new in UiPath.

1 Like

Sure give me a minute

Hi
Hope these steps would help you resolve this
—use a excel application scope and pass the filepath of excel as input
—inside the scope use READ RANGE activity and get the output with a variable of type datatable named dt

—then use a WRITE CELL activity and mention the input string as dt.Columns(1).ColumnName.ToString and cell range as “F1”
And another WRITE CELL activity where input string as dt.Columns(3).ColumnName.ToString and cell range as “G1”

—now use a FOR EACH ROW activity and pass the above variable dt as input
—inside the loop use WRITE CELL ACTIVITY and mention the input string as as IF(row(1).ToString.Contains(“Yes”),”1”,”0”).ToString and in the cell range mention as “F”+(dt.Rows.IndexOf(row)+2).ToString
—similarly another WRITE CELL activity and mention the input string as
IF(row(3).ToString.Contains(“Yes”),”1”,”0”).ToString and in the cell range mention as “G”+(dt.Rows.IndexOf(row)+2).ToString

Cheers @SAHIL_PANDITA

1 Like

New folder (4).zip (7.4 KB)
use @Palaniyappan method to move column value
find above file to replace
Cheers @SAHIL_PANDITA

Hii Pradeep,

Thanks for your help.
Please find the screenshot, I need this type of output.
I’m refereeing your example,please suggest where can I change or edit your example and send back.

Thanks in advance.

image

1 Like

Hi
here you go with a xaml
hope its resolved
kindly try this and let know for any queries or clarification
writecell.zip (9.9 KB)

Cheers @SAHIL_PANDITA

1 Like

Hii Palaniyappan,

Its not working, please check and share the excel file also.

1 Like

Awaiting for your response.

row(1).ToString.Contains(“Yes”) And row(3).ToString.Contains(“No”)

Can you please elaborate the above exprssion.

row(1).ToString.Contains(“Yes”) And row(3).ToString.Contains(“No”)
we are looping through rows and checking if any row contains the value “Yes” then do the process

What defines row(1) and row(3) in the mentioned expression.
What about row(2) and others.

row(1) is your “Employee” column
row(3) is your “Reserve” column
and row(2) is your “Dept” Column

you can mention like this also row(“Employee”).ToString

Hii Pradeep,
Greeting :slight_smile:

I’m referring your file but its not changing all fields as shown in the below attachment.
Please check and suggest some changes.

New folder (4).zip (8.2 KB)
image

1 Like

Sure


it’s working fine for me

1 Like