Calculate a formula when enter text

K

KG

I'm wanting to have a cell calculate a formula when I enter a 'Y' in that
cell. Is this possible? If so, what formula/function would I use? Thanks
 
J

Jacob Skaria

You cannot have a formula and a value entered into the same cell. Instead you
can set a condition in a formula based on a value in other cell for example

=IF(A1="Y",<formula>,"")

It would be better to detail your requirement; there may be other ways to
acheive the same result.

If this post helps click Yes
 
B

Bernard Liengme

You cannot put Y in a cell and have the SAME cell do a calculation
You can put Y in one cell and have a calculation in ANOTHER cell
Suppose I enter Y (or N or nothing) in D1 and in E1 I can have
=IF(D1="Y",A1/B1,"")
When there is a Y in D1 I get the result of the calculation A1/B1 otherwise
I get blank (that is the meaning of two double quotes with nothing between
them
best wishes
 
K

KG

Thanks Jacob. I'll see if I can explain it clearly. Because I'd really
appreciate the help. I am designing a spreadsheet for a staff roster system.
The staff work one-on-one with individual disability clients. I want to be
able to put a Y for a particular staff member in a cell where the column is
dedicated to a particular client's session. But depending on the client
chosen (I have them and their individual session times listed underneath each
other in columns A-C - i.e. A1 Client1 Name; A2 Start Time; A3 Finish Time;
A2 Client2 Name ...). My aim is to have it calculate the total time to pay a
staff member based on how many Y's are in that column. Your formula you gave
makes sense but can I string them together in the one cell as a total of a
combination of Y's in that column. Oh dear... this sounds complicated even to
me and I've been looking at this thing for the last day. Hope you can make
some sense out of my ramblings. Thanks muchly.
 
K

KG

Thanks Bernard, Is it possible to string this formula together to basically
pluck the Y from a number of different cells and add them all together in a
seperate cell to get a combined total.
 
B

Bernard Liengme

=COUNTIF(A1:A20,"Y")
will count how many Y's in the range A1:A20
best wishes
 
J

Jacob Skaria

COUNTIF(A:A,"Y") will give total Y in Col A. you can use that in another
formula for example multiply by 10

=COUNTIF(A:A,"Y")*10


If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top