Excel formular question

may I ask that how can i make a excel formular in this case:

To count the number of data which is other than 3N, 4N, 5N, 6N

Hi @Happydayyy

Check the below linq expression,

- Assign -> Count =Input_dt.AsEnumerable.Count(Function(X) Not(X("Column name").ToString.Equals("3N") And X("Column name").ToString.Equals("4N") and X("Column name").ToString.Equals("5N") and X("Column name").ToString.Equals("6N")))

Note : Change the column name in the expression based on your reqirement.

Hope it helps!!

1 Like

I just want to write the excel formular in the cell. but i am wordering what excel formular (=…) I need to write.
Do you know how to set this excel formular?

Okay @Happydayyy

Then use the excel activities, Check the below process,
→ Use the Excel process scope activity and insert the use excel file activity inside of it, pass the excel file path in Use excel file activity.
→ Inside Use excel file activity insert the Write cell activity and give the below formula in what to write field.

=COUNTIFS(K1:K32, "<>3N", K1:K32, "<>4N",K1:K32,"<>5N",K1:K32,"<>6N")

Hope it helps!!

Or if you want to do it manually then you can directly use the formula in the last cell of the column… @Happydayyy

=COUNTIFS(K1:K32, "<>3N", K1:K32, "<>4N",K1:K32,"<>5N",K1:K32,"<>6N")

Hope you understand!!

Check the below image for better understanding… @Happydayyy

Thank you so much , but when it apply in my case, sth get error


Can u help me check on it?

Hi @Happydayyy

Use the below one:

"=COUNTIFS(K1:K1000, ""<>3N"", K1:K1000, ""<>4N"", K1:K1000, ""<>Ky"", K1:K1000, ""<>KR"", K1:K1000, ""<>Kw(Ni)"", K1:K1000, ""<>Kw(Pd)"")"

Hope it helps!!

1 Like

Thank you so much
but it seems count the blank cell as well, how can I only count the object?

Hi @Happydayyy

Try this:

"=COUNTIFS(K1:K1000, ""<>3N"", K1:K1000, ""<>4N"", K1:K1000, ""<>Ky"", K1:K1000, ""<>KR"", K1:K1000, ""<>Kw(Ni)"", K1:K1000, ""<>Kw(Pd)"", K1:K1000, ""<>"")"

Hope it helps!!

1 Like


Still error…

Hi @Happydayyy

Try this forumula:

"=COUNTIFS(K2:K259, ""<>3N"", K2:K259, ""<>4N"", K2:K259, ""<>Ky"", K2:K259, ""<>KR"", K2:K259, ""<>Kw(Ni)"", K2:K259, ""<>Kw(Pd)"", K2:K259, ""<>"")"

Hope it helps!!

Because the area is based on the number of data in main sheet, so the number of data will be different, i can’t just use the specific number ie K2:K259, I must use up to K1000.

So i am still thinking solutions to cope with this…

I use your formular but its still have 223


But it is suppose to have 7 only

WB templ. 27.2.24.xlsx (83.0 KB)
check on sheet "MU-bias (Robot)

Okay @Happydayyy

I have made a Workflow for this,
→ Use the Find First\Last row activity to get the last row of the Type of sample Column, in the Save Last row number as Field create a variable called LastRow.
→ After Find First\Last row activity insert the Write cell activity and give the below expression in What to write field,

"=COUNTIFS(K2:K"+LastRow.ToString+", ""<>3N"", K2:K"+LastRow.ToString+", ""<>4N"", K2:K"+LastRow.ToString+", ""<>Ky"", K2:K"+LastRow.ToString+", ""<>KR"", K2:K"+LastRow.ToString+", ""<>Kw(Ni)"", K2:K"+LastRow.ToString+", ""<>Kw(Pd)"", K2:K"+LastRow.ToString+", ""<> "",K2:K"+LastRow.ToString+",""<>"")"

Check the below workflow for better understanding,
Regex_Practice.xaml (18.3 KB)

output -

Hope it helps!!

1 Like

Thank you so much, the issue has been fixed.
I am going to do the task similar as this case in the following. If i hv some issue, can you ans me as well? many thanksssss!!!

1 Like

@mkankatala please go to Write cell issue if no data
there has sth wrong with the formular if the sheet contain no data, thanks for your help!!

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