Ask Your Question
0

I want to check for a string and then add to another variable

asked 2017-03-01 18:34:22 +0100

KristopMe gravatar image

What I am trying to do is be able to input into a space either a "yes", "no", or "late" and then add to a tally in another space dependent on what was entered.

I have been looking at either nested if statements or at the vlookup function but I wanted to see if anyone would know a more efficient way of doing it?

edit retag flag offensive close merge delete

Comments

What's a "space" in your terms? A cell?
Do you expect the tally to count along based on the "previous state"? (Spradsheets are not history aware.)

Lupp gravatar imageLupp ( 2017-03-01 19:11:58 +0100 )edit

im sorry. by space I meant cell.

KristopMe gravatar imageKristopMe ( 2017-03-01 19:45:32 +0100 )edit

I suppose another way to put it is that I want a cell to check it's row for a given string and then count up the number of times it is in the row.

KristopMe gravatar imageKristopMe ( 2017-03-01 19:52:28 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-03-01 21:22:36 +0100

Lupp gravatar image

updated 2017-03-01 21:23:11 +0100

=COUNTIF($A10:$K10;"yes") in L10 =COUNTIF($A10:$K10;"no") in M10 =COUNTIF($A10:$K10;"late") in N10 e.g.
Better enter the strings to look for in dedicated cells and replace the string constants by the respective references.

=SUMPRODUCT($A10:$K10="yes") in L10 and so on may look a bit strange, but is better than the above formula, imo.

(Read the help texts about functions. You may exclude many not usable for you.)

edit flag offensive delete link more

Comments

This is EXACTLY what I was looking for thank you so much!

KristopMe gravatar imageKristopMe ( 2017-03-01 22:06:17 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-03-01 18:34:22 +0100

Seen: 27 times

Last updated: Mar 01 '17