ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Calculate a formula when enter text (https://www.excelbanter.com/excel-worksheet-functions/232443-calculate-formula-when-enter-text.html)

KG

Calculate a formula when enter text
 
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

Jacob Skaria

Calculate a formula when enter text
 
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
---------------
Jacob Skaria


"KG" wrote:

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


Bernard Liengme

Calculate a formula when enter text
 
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
--
Bernard Liengme
MVP Excel
http://people.stfx.ca

"KG" wrote in message
...
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



KG

Calculate a formula when enter text
 
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.

"Jacob Skaria" wrote:

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
---------------
Jacob Skaria


"KG" wrote:

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


KG

Calculate a formula when enter text
 
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.

"Bernard Liengme" wrote:

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
--
Bernard Liengme
MVP Excel
http://people.stfx.ca

"KG" wrote in message
...
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



Bernard Liengme

Calculate a formula when enter text
 
=COUNTIF(A1:A20,"Y")
will count how many Y's in the range A1:A20
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"KG" wrote in message
...
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.

"Bernard Liengme" wrote:

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
--
Bernard Liengme
MVP Excel
http://people.stfx.ca

"KG" wrote in message
...
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




Jacob Skaria

Calculate a formula when enter text
 
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
---------------
Jacob Skaria


"KG" wrote:

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.

"Jacob Skaria" wrote:

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
---------------
Jacob Skaria


"KG" wrote:

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


KG

Calculate a formula when enter text
 
Thanks Bernard, All good.

"Bernard Liengme" wrote:

=COUNTIF(A1:A20,"Y")
will count how many Y's in the range A1:A20
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"KG" wrote in message
...
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.

"Bernard Liengme" wrote:

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
--
Bernard Liengme
MVP Excel
http://people.stfx.ca

"KG" wrote in message
...
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





All times are GMT +1. The time now is 05:42 AM.

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