ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Using the Time function with an IF statement (https://www.excelbanter.com/excel-worksheet-functions/451458-using-time-function-if-statement.html)

Allison Mazurek

Using the Time function with an IF statement
 
HI - I was hoping someone could help me with a time function.

=IF(W2=$B$2,IF($Z$2TIME(11,30,0),'Current Day Balances'!$B$4-'Current Day Balances'!$D$4,'Current Day Balances'!$F$4-'Current Day Balances'!$D$4),0)

W2 is a date and B2 is today's date. Cell Z2 holds the time in military time.
If it is today before 1:30pm, I would like it to subtract two cells. If it is today after 1:30pm, I want it to subtract two different cells. And if it isn't today, to equal zero.

For some reason, I am getting True statement no matter what time it is.
Can someone help me?

Thanks.

Claus Busch

Using the Time function with an IF statement
 
Hi Allison,

Am Fri, 27 May 2016 13:31:07 -0700 (PDT) schrieb Allison Mazurek:

=IF(W2=$B$2,IF($Z$2TIME(11,30,0),'Current Day Balances'!$B$4-'Current Day Balances'!$D$4,'Current Day Balances'!$F$4-'Current Day Balances'!$D$4),0)


try:
=IF(W2<$B$2,0,IF($Z$2TIME(11,30,0),'Current Day Balances'!$B$4-'Current Day Balances'!$D$4,'Current Day Balances'!$F$4-'Current Day Balances'!$D$4))


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional

Allison Mazurek

Using the Time function with an IF statement
 
Unfortunately, it did not. It keeps picking up the first value statment.

=IF(V2<$B$2,0,IF($Z$2TIME(11,30,0),'Current Day Balances'!$B$4-'Current Day Balances'!$D$4,'Current Day Balances'!$F$4-'Current Day Balances'!$D$4))

On Friday, May 27, 2016 at 3:49:27 PM UTC-5, Claus Busch wrote:
Hi Allison,

Am Fri, 27 May 2016 13:31:07 -0700 (PDT) schrieb Allison Mazurek:

=IF(W2=$B$2,IF($Z$2TIME(11,30,0),'Current Day Balances'!$B$4-'Current Day Balances'!$D$4,'Current Day Balances'!$F$4-'Current Day Balances'!$D$4),0)


try:
=IF(W2<$B$2,0,IF($Z$2TIME(11,30,0),'Current Day Balances'!$B$4-'Current Day Balances'!$D$4,'Current Day Balances'!$F$4-'Current Day Balances'!$D$4))


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


Claus Busch

Using the Time function with an IF statement
 
Hi Allison,

Am Fri, 27 May 2016 15:23:54 -0700 (PDT) schrieb Allison Mazurek:

Unfortunately, it did not. It keeps picking up the first value statment.

=IF(V2<$B$2,0,IF($Z$2TIME(11,30,0),'Current Day Balances'!$B$4-'Current Day Balances'!$D$4,'Current Day Balances'!$F$4-'Current Day Balances'!$D$4))


sorry, I forgot that in Z2 is a military time without colon. You have to
convert it in a regular time. Try:
=IF(V2<$B$2,0,IF(TIME(LEFT($Z$2,2),RIGHT($Z$2,2), 0)TIME(11,30,0),'Current Day Balances'!B4-'Current Day Balances'!D4,'Current Day Balances'!F4-'Current Day Balances'!D4))


Regards
Claus B.
--
Windows10
Office 2016

Allison Mazurek

Using the Time function with an IF statement
 
It still is answering as TRUE every time even if I change the time in the formula.

On Friday, May 27, 2016 at 5:39:34 PM UTC-5, Claus Busch wrote:
Hi Allison,

Am Fri, 27 May 2016 15:23:54 -0700 (PDT) schrieb Allison Mazurek:

Unfortunately, it did not. It keeps picking up the first value statment.

=IF(V2<$B$2,0,IF($Z$2TIME(11,30,0),'Current Day Balances'!$B$4-'Current Day Balances'!$D$4,'Current Day Balances'!$F$4-'Current Day Balances'!$D$4))


sorry, I forgot that in Z2 is a military time without colon. You have to
convert it in a regular time. Try:
=IF(V2<$B$2,0,IF(TIME(LEFT($Z$2,2),RIGHT($Z$2,2), 0)TIME(11,30,0),'Current Day Balances'!B4-'Current Day Balances'!D4,'Current Day Balances'!F4-'Current Day Balances'!D4))


Regards
Claus B.
--
Windows10
Office 2016



Claus Busch

Using the Time function with an IF statement
 
Hi Allison,

Am Tue, 31 May 2016 09:58:28 -0700 (PDT) schrieb Allison Mazurek:

It still is answering as TRUE every time even if I change the time in the formula.


please upload your workbook and post the link here.


Regards
Claus B.
--
Windows10
Office 2016


All times are GMT +1. The time now is 10:44 PM.

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