Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
polk383
 
Posts: n/a
Default :confused: Nested if then else statement


Hello All!
I never tried to do anything like this before so here goes! I am
trying to create a nested if then else statement. What I have is 7
fields one of which I created the other 6 where exported data. In the
6th field I have times in there that is subtracting a from fields B and
C. In field H There are times in the format [h]:mm:ss. I need to have
a statement showing that if the time is below 1:00:00 then in the cell
will be "less than 1 hour" if it is between 2 - 4 hours it will say
"between 2 - 4 hours" and if it is over 4 hours then it will show "Over
4 hours" Here is what I have created so far and I am unable to get this
thing to function correctly.


Code:
--------------------
=IF(H2<1:00:00,"Less than 1 hour",IF(H22:00:00,"Over 2 hours",IF(H24:00:00,"Over four hours")))
--------------------


I am at a loss to get this thing to see between 2 - 4 hours and just to
get it to function correctly!

Thanks everyone!!


--
polk383
------------------------------------------------------------------------
polk383's Profile: http://www.excelforum.com/member.php...o&userid=34884
View this thread: http://www.excelforum.com/showthread...hreadid=546286

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default :confused: Nested if then else statement


What if the time is between 1 and 2 hours? Perhaps something like this

=IF(H2<"1:00:00"+0,"Less than 1 hour",IF(H2"4:00"+0,"Over 4
hours",IF(H2"2:00"+0,"Over two hours","between 1 and two hours")))


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=546286

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pdberger
 
Posts: n/a
Default :confused: Nested if then else statement

Polk --

The problem lies in the 2nd part of your 'if' statement. It doesn't address
what happens between 1 & 2 hours and, if it's ANY time over two hours, then
you only get one answer. You want to keep your 'greater than' or 'less than'
consistent. So you might try:

=IF(H2<1:00:00,"Less than 1 hour",IF(H2<2:00:00,"1 to 2
hours",IF(H2<4:00:00,"2 to 4 hours")))

etc.

HTH

"polk383" wrote:


Hello All!
I never tried to do anything like this before so here goes! I am
trying to create a nested if then else statement. What I have is 7
fields one of which I created the other 6 where exported data. In the
6th field I have times in there that is subtracting a from fields B and
C. In field H There are times in the format [h]:mm:ss. I need to have
a statement showing that if the time is below 1:00:00 then in the cell
will be "less than 1 hour" if it is between 2 - 4 hours it will say
"between 2 - 4 hours" and if it is over 4 hours then it will show "Over
4 hours" Here is what I have created so far and I am unable to get this
thing to function correctly.


Code:
--------------------
=IF(H2<1:00:00,"Less than 1 hour",IF(H22:00:00,"Over 2 hours",IF(H24:00:00,"Over four hours")))
--------------------


I am at a loss to get this thing to see between 2 - 4 hours and just to
get it to function correctly!

Thanks everyone!!


--
polk383
------------------------------------------------------------------------
polk383's Profile: http://www.excelforum.com/member.php...o&userid=34884
View this thread: http://www.excelforum.com/showthread...hreadid=546286


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
 
Posts: n/a
Default :confused: Nested if then else statement

=IF(H2TIMEVALUE("4:00:00"),"Over four
hours",IF(H2TIMEVALUE("2:00:00"),"Over 2
hours",IF(H2TIMEVALUE("1:00:00"),"1-2 hours","Less than 1 hour")))

HTH
--
AP

"polk383" a écrit
dans le message de news:
...

Hello All!
I never tried to do anything like this before so here goes! I am
trying to create a nested if then else statement. What I have is 7
fields one of which I created the other 6 where exported data. In the
6th field I have times in there that is subtracting a from fields B and
C. In field H There are times in the format [h]:mm:ss. I need to have
a statement showing that if the time is below 1:00:00 then in the cell
will be "less than 1 hour" if it is between 2 - 4 hours it will say
"between 2 - 4 hours" and if it is over 4 hours then it will show "Over
4 hours" Here is what I have created so far and I am unable to get this
thing to function correctly.


Code:
--------------------
=IF(H2<1:00:00,"Less than 1 hour",IF(H22:00:00,"Over 2
hours",IF(H24:00:00,"Over four hours")))
--------------------


I am at a loss to get this thing to see between 2 - 4 hours and just to
get it to function correctly!

Thanks everyone!!


--
polk383
------------------------------------------------------------------------
polk383's Profile:
http://www.excelforum.com/member.php...o&userid=34884
View this thread: http://www.excelforum.com/showthread...hreadid=546286



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
polk383
 
Posts: n/a
Default :confused: Nested if then else statement


Good deal! I am liking all of these guys thank you very much! :)


--
polk383
------------------------------------------------------------------------
polk383's Profile: http://www.excelforum.com/member.php...o&userid=34884
View this thread: http://www.excelforum.com/showthread...hreadid=546286

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested IF Statement Question EleKtriKaz Excel Discussion (Misc queries) 6 April 5th 06 06:21 AM
I have run out of arguments for nested IF statement christopherp Excel Discussion (Misc queries) 5 March 19th 06 12:26 PM
Problem with nested IF_OR statement DOOGIE Excel Worksheet Functions 7 June 24th 05 03:27 AM
Nested If statement Jock W Excel Worksheet Functions 3 March 22nd 05 06:56 PM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM


All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"