ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I get my function to subtract .5? (https://www.excelbanter.com/excel-worksheet-functions/107633-how-do-i-get-my-function-subtract-5-a.html)

etabolt

How do I get my function to subtract .5?
 
Hello. I am working on an attendance sheet and am trying to figure out how
to subtract .5 from my total when calculating vacation days. I currently am
using the formula C6=COUNTIF($G6:$CQ6, "v"). This way if I use the value "v"
on any of the dates, it counts it toward vacation days used. My problem is
that we allow employees to also use 1/2 days of vacation. What do I need to
do to allow the count to subtract .5 when using the variable "hv" for half
days of vacation?

David Billigmeier

How do I get my function to subtract .5?
 
=SUMPRODUCT(($G6:$CQ6="V")+($G6:$CQ6="hv")*0.5)

--
Regards,
Dave


"etabolt" wrote:

Hello. I am working on an attendance sheet and am trying to figure out how
to subtract .5 from my total when calculating vacation days. I currently am
using the formula C6=COUNTIF($G6:$CQ6, "v"). This way if I use the value "v"
on any of the dates, it counts it toward vacation days used. My problem is
that we allow employees to also use 1/2 days of vacation. What do I need to
do to allow the count to subtract .5 when using the variable "hv" for half
days of vacation?


Pete_UK

How do I get my function to subtract .5?
 
Try this:

=COUNTIF($G6:$CQ6,"v") - COUNTIF($G6:$CQ6,"hv")*0.5

Hope this helps.

Pete

etabolt wrote:
Hello. I am working on an attendance sheet and am trying to figure out how
to subtract .5 from my total when calculating vacation days. I currently am
using the formula C6=COUNTIF($G6:$CQ6, "v"). This way if I use the value "v"
on any of the dates, it counts it toward vacation days used. My problem is
that we allow employees to also use 1/2 days of vacation. What do I need to
do to allow the count to subtract .5 when using the variable "hv" for half
days of vacation?



Pete_UK

How do I get my function to subtract .5?
 
Sorry, should be plus, not minus.

Pete

Pete_UK wrote:
Try this:

=COUNTIF($G6:$CQ6,"v") - COUNTIF($G6:$CQ6,"hv")*0.5

Hope this helps.

Pete

etabolt wrote:
Hello. I am working on an attendance sheet and am trying to figure out how
to subtract .5 from my total when calculating vacation days. I currently am
using the formula C6=COUNTIF($G6:$CQ6, "v"). This way if I use the value "v"
on any of the dates, it counts it toward vacation days used. My problem is
that we allow employees to also use 1/2 days of vacation. What do I need to
do to allow the count to subtract .5 when using the variable "hv" for half
days of vacation?



etabolt

How do I get my function to subtract .5?
 
Thank you so much, David! This formula was exactly what I needed :)

"David Billigmeier" wrote:

=SUMPRODUCT(($G6:$CQ6="V")+($G6:$CQ6="hv")*0.5)

--
Regards,
Dave


"etabolt" wrote:

Hello. I am working on an attendance sheet and am trying to figure out how
to subtract .5 from my total when calculating vacation days. I currently am
using the formula C6=COUNTIF($G6:$CQ6, "v"). This way if I use the value "v"
on any of the dates, it counts it toward vacation days used. My problem is
that we allow employees to also use 1/2 days of vacation. What do I need to
do to allow the count to subtract .5 when using the variable "hv" for half
days of vacation?



All times are GMT +1. The time now is 11:06 AM.

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