Ask Your Question

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

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

KristopMe gravatar image

updated 2020-09-26 12:03:00 +0100

Alex Kemp 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 reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-09-26 12:03:09.626519


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

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


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

KristopMe gravatar imageKristopMe ( 2017-03-01 22:06:17 +0100 )edit

Question Tools

1 follower


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

Seen: 44 times

Last updated: Mar 01 '17