ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Formula question (https://www.excelbanter.com/new-users-excel/251310-formula-question.html)

roberta

Formula question
 
I need help with getting a formula to work.

I have a spreadsheet that add time accured and subtracts time used... what I
need is for it to stop and not continue to add accured time if the max is
reached.

Thanks for any help offered.

Gary''s Student

Formula question
 
If the accurals are in column A and the used are in column B:
=MIN(SUM(A1:A100)-SUM(B1:B100),1234)

where 1234 is the max
--
Gary''s Student - gsnu200909


"Roberta" wrote:

I need help with getting a formula to work.

I have a spreadsheet that add time accured and subtracts time used... what I
need is for it to stop and not continue to add accured time if the max is
reached.

Thanks for any help offered.


Joe User[_2_]

Formula question
 
"Roberta" wrote:
I have a spreadsheet that add time accured and subtracts time used.
what I need is for it to stop and not continue to add accured time if the
max is reached.


A concrete numerical example would help resolve ambiguities in the English
description.

Perhaps one of the following will work for you:

=min(--"12:30", sum(A1:A10)) - sum(B1:B10)

=min(--"12:30", sum(A1:A10) - sum(B1:B10))

In both case, the formula results in the lesser of 12h 30m and something
else. The "--" has the effect of converting the string to a time value.

This assumes that you have bona fide time values in A1:A10 (time accrued)
and B1:B10 (time used), not text. If you (temporarily) format the cells as
hh:mm, you should see the times that you expect.


All times are GMT +1. The time now is 09:50 PM.

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