ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If Statement (https://www.excelbanter.com/excel-discussion-misc-queries/202139-if-statement.html)

khicks4u

If Statement
 
I have a column that houses a time. The column may have 2000 rows. I would
like to enter an IF statement in the column next to it to identify what hour
this time falls into, but can it handle 24 possibilities?

Time Result
1330 13:00 to 13:59
1615 16:00 to 16:59
2020 20:00 to 20:59

Thanks Kem

Mike H

If Statement
 
Try this instead

=HOUR(A2) &":00 to "& HOUR(A2) &":59"

Drag down

Mike

"khicks4u" wrote:

I have a column that houses a time. The column may have 2000 rows. I would
like to enter an IF statement in the column next to it to identify what hour
this time falls into, but can it handle 24 possibilities?

Time Result
1330 13:00 to 13:59
1615 16:00 to 16:59
2020 20:00 to 20:59

Thanks Kem


Stefi

If Statement
 
=TEXT(TIME(HOUR(A2),0,0),"hh:mm")&" to "&TEXT(TIME(HOUR(A2),59,0),"hh:mm")

Regards,
Stefi

€˛khicks4u€¯ ezt Ć*rta:

I have a column that houses a time. The column may have 2000 rows. I would
like to enter an IF statement in the column next to it to identify what hour
this time falls into, but can it handle 24 possibilities?

Time Result
1330 13:00 to 13:59
1615 16:00 to 16:59
2020 20:00 to 20:59

Thanks Kem


khicks4u

If Statement
 
You are a life saver Mike!!!!! Thank you that worked. Is there a way I can
get the format to be 01:00 to 01:59 instead of 1:00 to 1:59?

"Mike H" wrote:

Try this instead

=HOUR(A2) &":00 to "& HOUR(A2) &":59"

Drag down

Mike

"khicks4u" wrote:

I have a column that houses a time. The column may have 2000 rows. I would
like to enter an IF statement in the column next to it to identify what hour
this time falls into, but can it handle 24 possibilities?

Time Result
1330 13:00 to 13:59
1615 16:00 to 16:59
2020 20:00 to 20:59

Thanks Kem


David Biddulph[_2_]

If Statement
 
=HOUR(--TEXT(A2,"00\:00"))&":00 to "&HOUR(--TEXT(A2,"00\:00"))&":59"
or =INT(A2/100)&":00 to "&INT(A2/100)&":59"
--
David Biddulph

"khicks4u" wrote in message
...
I have a column that houses a time. The column may have 2000 rows. I
would
like to enter an IF statement in the column next to it to identify what
hour
this time falls into, but can it handle 24 possibilities?

Time Result
1330 13:00 to 13:59
1615 16:00 to 16:59
2020 20:00 to 20:59

Thanks Kem




Mike H

If Statement
 
Yes,

=TEXT(TIME(HOUR(A2),0,0),"hh") &":00 to "& HOUR(A2) &":59"

Mike

"khicks4u" wrote:

You are a life saver Mike!!!!! Thank you that worked. Is there a way I can
get the format to be 01:00 to 01:59 instead of 1:00 to 1:59?

"Mike H" wrote:

Try this instead

=HOUR(A2) &":00 to "& HOUR(A2) &":59"

Drag down

Mike

"khicks4u" wrote:

I have a column that houses a time. The column may have 2000 rows. I would
like to enter an IF statement in the column next to it to identify what hour
this time falls into, but can it handle 24 possibilities?

Time Result
1330 13:00 to 13:59
1615 16:00 to 16:59
2020 20:00 to 20:59

Thanks Kem


Mike H

If Statement
 
Hmmm,

That doesn't work and I just noticed Stefi has posted a solution.

Mike

"Mike H" wrote:

Yes,

=TEXT(TIME(HOUR(A2),0,0),"hh") &":00 to "& HOUR(A2) &":59"

Mike

"khicks4u" wrote:

You are a life saver Mike!!!!! Thank you that worked. Is there a way I can
get the format to be 01:00 to 01:59 instead of 1:00 to 1:59?

"Mike H" wrote:

Try this instead

=HOUR(A2) &":00 to "& HOUR(A2) &":59"

Drag down

Mike

"khicks4u" wrote:

I have a column that houses a time. The column may have 2000 rows. I would
like to enter an IF statement in the column next to it to identify what hour
this time falls into, but can it handle 24 possibilities?

Time Result
1330 13:00 to 13:59
1615 16:00 to 16:59
2020 20:00 to 20:59

Thanks Kem



All times are GMT +1. The time now is 04:25 AM.

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