View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
muddan madhu muddan madhu is offline
external usenet poster
 
Posts: 747
Default Time convertion based on condition

Try this !

Suppose u have data in column A

select the data , then go to data | text to column | choose delimited
option | check space option | finish

In col A you have number and in col B you have week, days or hours

put this formula in Col C
=IF(B1="week",A1*7*24,IF(B1="days",B1*24,IF(B1="ho urs",A1,"")))


On May 28, 2:31*pm, "Bob Phillips" wrote:
=LEFT(A1,MIN(IF(ISERROR(1*(MID(A1,ROW(INDIRECT("A1 :A"&LEN(A1))),1))),
ROW(INDIRECT("A1:A"&LEN(A1))),255))-1)*(IF(ISNUMBER(SEARCH("week",A1)),188,*IF(ISNUMBE R(SEARCH("day",A1)),24,1)))

this is an array formula, so commit with Ctrl-Shift-Enter

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Maglez" wrote in message

...



Hello.


How can I inspect cells which contain data like...
2 weeks
1 day
3.2 hours


and convert them all to hours as...
336 hours
24 hours
3.2 hours


I have been playing with the conditional IF and the text command SEARCH....


* *=IF(SEARCH("days",G4),1,0)


...but I am able only to perform 1 condition, I don't know if there is a
better approach to do this.- Hide quoted text -


- Show quoted text -