Pasar horas minutos y segundos a varias celdas

manuelmejuto

New Member
Joined
Mar 16, 2011
Messages
2
Buenas a todos y gracias por este foro de ayuda.
Tengo el siguiente problema , a ver si desde este foro se puede prestar la ayuda necesaria
Tengo una serie de valores en h , m y ss y quiero que de esos valores desparezcan las letras h , el valor ' y el valor " y me queden solo los numeros y en diferentes columnas , una para las horas , otra para los minutos y otra para los segundos. Yo consigo hacerlo cuando la cantidad es completa es decir 1h 55' 0" (y no son mas de 9h) pero cuando no tiene horas me da error la formula o cuando son solo segundos .
Creo que es un lio tal cual lo he explicado espero que se entienda con el ejemplo :


<table border="0" cellpadding="0" cellspacing="0" height="170" width="403"><col style="width: 60pt;" span="4" width="80"> <tbody><tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; width: 60pt;" height="20" width="80">T. Efect.</td> <td class="xl65" style="width: 60pt;" width="80">Horas</td> <td class="xl65" style="width: 60pt;" width="80">Min</td> <td class="xl65" style="width: 60pt;" width="80">Seg</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl66" style="height: 15pt;" height="20">1h 55' 14"</td> <td class="xl67" style="border-left: medium none;">1</td> <td class="xl67" style="border-left: medium none;">55</td> <td class="xl67" style="border-left: medium none;">14</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl68" style="height: 15pt; border-top: medium none;" height="20">56' 3"</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">0</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">56</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">3</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl69" style="height: 15pt; border-top: medium none;" height="20">14h 2' 26"</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">14</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">2</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">26</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl69" style="height: 15pt; border-top: medium none;" height="20">35"</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">0</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">0</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">35</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl69" style="height: 15pt; border-top: medium none;" height="20">3"</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">0</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">0</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">3</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl69" style="height: 15pt; border-top: medium none;" height="20">1h 0' 36"</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">1</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">0</td> <td class="xl67" style="border-top: medium none; border-left: medium none;">36</td> </tr> </tbody></table>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Bienvenido a MrExcel, Manuel.

Usted no nos dijo que está usando una versión antigua de Excel. Entonces me imagino que usa la 2010, o por lo menos 2007. Suponiendo esto, las siguientes fórmulas le daría los resultados que busca:

para B2 y copiado hacia abajo:
=IFERROR(LEFT(A2,FIND("h",A2)-1)+0,0)

para C2 y copiado hacia abajo:
=IFERROR(MID(A2,IF(ISNUMBER(FIND("h",A2)),FIND("h",A2)+1,1), FIND("'",A2)-IF(ISNUMBER(FIND("h",A2)),FIND("h",A2)+1,1))+0,0)

para D2 y copiado hacia abajo:
=IFERROR(SUBSTITUTE(RIGHT(A2,LEN(A2)-FIND("'",A2)-1),"""","")+0,IF(ISNUMBER(FIND("""",A2)),SUBSTITUTE(A2,"""","")+0,0))
 
Upvote 0
Intente con esto, es algo parecido a lo que sugiere Greg, pero partiendo las fórmulas.
Excel Workbook
ABCDEFG
1T. Efect.Posicin hPosicin 'Posicin "HorasMinSeg
21h 55' 14"261015514
356' 3"#VALUE!360563
414h 2' 26"361014226
535"#VALUE!#VALUE!30035
63"#VALUE!#VALUE!2003
71h 0' 36"2591036
Sheet1
Excel 2007
Cell Formulas
RangeFormula
B2=SEARCH("h",$A2)
C2=SEARCH("'",$A2)
D2=SEARCH("""",$A2)
E2=IF(ISNUMBER(B2),LEFT(A2,B2-1)+0,0)
F2=IF(ISNUMBER(C2),MID($A2,IF(ISNUMBER(B2),B2+2,1),C2-IF(ISNUMBER(B2),B2+2,1))+0,0)
G2=IF(ISNUMBER(D2),MID($A2,IF(ISNUMBER(C2),C2+2,1),D2-IF(ISNUMBER(C2),C2+2,1))+0,0)
 
Upvote 0
¡Hola, Juan Pablo! ¡Que gusto verlo por aquí! ¿Y cómo está Jerónimo? ¿Ya cumplió un año, verdad?
 
Upvote 0
Me imagino que sí. En la entrada del foro de otros idiomas Jon puso un "sticky" con vínculos a un par de herramientas para traducir fórmulas. El "sticky" tiene el título "Worksheet Function Translations".

Atte,
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top