ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional execution (https://www.excelbanter.com/excel-programming/340589-conditional-execution.html)

Raja

Conditional execution
 
i have 100*100 cells..
which look like
A B C D
x yes no yes
y yes yes no
z no no no

if (yes) then c=1 and it should be added to column E
for all rows...

Cush

Conditional execution
 
if (yes) then c=1 and it should be added to column E
for all rows...

If WHAT = "yes"

and WHAT should be added to column E?

and when you say "c=1", do you mean that you want to
change the value of the "yes" or "no" in column c of that row to a "1"?

You need to be much more specific in phrasing your question.

"raja" wrote:

i have 100*100 cells..
which look like
A B C D
x yes no yes
y yes yes no
z no no no

if (yes) then c=1 and it should be added to column E
for all rows...


Raja

Conditional execution
 
i want to substitue 1 for "yes" and 0 for "no"

then i want to add up all the 1's to a variable and display in the column E

"yes" means the values in the cells


"cush" wrote:

if (yes) then c=1 and it should be added to column E

for all rows...

If WHAT = "yes"

and WHAT should be added to column E?

and when you say "c=1", do you mean that you want to
change the value of the "yes" or "no" in column c of that row to a "1"?

You need to be much more specific in phrasing your question.

"raja" wrote:

i have 100*100 cells..
which look like
A B C D
x yes no yes
y yes yes no
z no no no

if (yes) then c=1 and it should be added to column E
for all rows...


Raja

Conditional execution
 
i want to substitue 1 for "yes" and 0 for "no"

then i want to add up all the 1's to a variable and display in the column E

"cush" wrote:

if (yes) then c=1 and it should be added to column E

for all rows...

If WHAT = "yes"

and WHAT should be added to column E?

and when you say "c=1", do you mean that you want to
change the value of the "yes" or "no" in column c of that row to a "1"?

You need to be much more specific in phrasing your question.

"raja" wrote:

i have 100*100 cells..
which look like
A B C D
x yes no yes
y yes yes no
z no no no

if (yes) then c=1 and it should be added to column E
for all rows...


Vacation's Over

Conditional execution
 
It's easier than that

=CountIf("YES", "Your range here")
this function will return the number of "Yes" cells in your range


"raja" wrote:

i want to substitue 1 for "yes" and 0 for "no"

then i want to add up all the 1's to a variable and display in the column E

"yes" means the values in the cells


"cush" wrote:

if (yes) then c=1 and it should be added to column E

for all rows...

If WHAT = "yes"

and WHAT should be added to column E?

and when you say "c=1", do you mean that you want to
change the value of the "yes" or "no" in column c of that row to a "1"?

You need to be much more specific in phrasing your question.

"raja" wrote:

i have 100*100 cells..
which look like
A B C D
x yes no yes
y yes yes no
z no no no

if (yes) then c=1 and it should be added to column E
for all rows...


Dave Peterson

Conditional execution
 
Oopsie...

=CountIf("Your range here", "yes")



Vacation's Over wrote:

It's easier than that

=CountIf("YES", "Your range here")
this function will return the number of "Yes" cells in your range

"raja" wrote:

i want to substitue 1 for "yes" and 0 for "no"

then i want to add up all the 1's to a variable and display in the column E

"yes" means the values in the cells


"cush" wrote:

if (yes) then c=1 and it should be added to column E
for all rows...

If WHAT = "yes"

and WHAT should be added to column E?

and when you say "c=1", do you mean that you want to
change the value of the "yes" or "no" in column c of that row to a "1"?

You need to be much more specific in phrasing your question.

"raja" wrote:

i have 100*100 cells..
which look like
A B C D
x yes no yes
y yes yes no
z no no no

if (yes) then c=1 and it should be added to column E
for all rows...


--

Dave Peterson

Cush

Conditional execution
 
Try this:

In cell E2 type: =Countif($B2:$D2,"Yes")

Then copy this down col E as far as needed.

"raja" wrote:

i want to substitue 1 for "yes" and 0 for "no"

then i want to add up all the 1's to a variable and display in the column E

"cush" wrote:

if (yes) then c=1 and it should be added to column E

for all rows...

If WHAT = "yes"

and WHAT should be added to column E?

and when you say "c=1", do you mean that you want to
change the value of the "yes" or "no" in column c of that row to a "1"?

You need to be much more specific in phrasing your question.

"raja" wrote:

i have 100*100 cells..
which look like
A B C D
x yes no yes
y yes yes no
z no no no

if (yes) then c=1 and it should be added to column E
for all rows...


Vacation's Over

Conditional execution
 
Thanks Dave -

"Dave Peterson" wrote:

Oopsie...

=CountIf("Your range here", "yes")



Vacation's Over wrote:

It's easier than that

=CountIf("YES", "Your range here")
this function will return the number of "Yes" cells in your range

"raja" wrote:

i want to substitue 1 for "yes" and 0 for "no"

then i want to add up all the 1's to a variable and display in the column E

"yes" means the values in the cells


"cush" wrote:

if (yes) then c=1 and it should be added to column E
for all rows...

If WHAT = "yes"

and WHAT should be added to column E?

and when you say "c=1", do you mean that you want to
change the value of the "yes" or "no" in column c of that row to a "1"?

You need to be much more specific in phrasing your question.

"raja" wrote:

i have 100*100 cells..
which look like
A B C D
x yes no yes
y yes yes no
z no no no

if (yes) then c=1 and it should be added to column E
for all rows...


--

Dave Peterson



All times are GMT +1. The time now is 12:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com