devo dividere in Excel un testo inserito in una cella formato da due parole e porle in due celle separate con un unica formula che contenga anche
=ANNULLA.SPAZI(MAIUSC
Moderatori: Anthony47, Flash30005
=MAIUSC(STRINGA.ESTRAI(A1;1;TROVA(" ";A1;1)-1))
=MAIUSC(STRINGA.ESTRAI(A1;TROVA(" ";A1;1)+1;LUNGHEZZA(A1)))
=MAIUSC(SINISTRA(ANNULLA.SPAZI(A1);TROVA(" ";ANNULLA.SPAZI(A1))-1))
=MAIUSC(ANNULLA.SPAZI(SOSTITUISCI(A1;A2;"";1)))
=MAIUSC(SINISTRA(ANNULLA.SPAZI(B!A1);TROVA(" ";ANNULLA.SPAZI(B!A1))-1))
=MAIUSC(ANNULLA.SPAZI(SOSTITUISCI(MAIUSC(B!A1);A2;"";1)))
trittico69 ha scritto:ok..e si può fare che se il testo è composto da 2 parole, la prima va in a1 e la seconda in b1...se composto da 3 parole, le prime due vanno in a1 e la terza in b1...se composto da più di 3, metà va in a1 e l'altra metà in b1..grazie!
Vedi la funzione TRITT descritta piu' avantio notato che se la cella a1 del foglio B è vuota mi da la scritta VALORE nella cella dov'è la formula...si puo fare ceh resti vuota senza la scritta VALORE?
Function tritt12(ByVal StartV, SeqN) As String
Dim MyTritt, newW As String, I As Integer, Blanks As Integer
Dim My1
For I = 1 To Len(StartV)
If Mid(StartV, I, 1) = " " And flacrt Then
newW = newW & Mid(StartV, I, 1): flacrt = False
Else
If Mid(StartV, I, 1) <> " " Then _
newW = newW & Mid(StartV, I, 1): flacrt = True
End If
Next I
MyTritt = Split(Trim(newW), " ")
If (SeqN) > 2 Then
tritt12 = ""
Else:
Select Case UBound(MyTritt, 1)
Case 0 To 1
If SeqN = 1 Then My1 = Array(0) Else My1 = Array(1)
Case 2
If SeqN = 1 Then My1 = Array(0, 1) Else My1 = Array(2)
Case 3
If SeqN = 1 Then My1 = Array(0, 1) Else My1 = Array(2, 3)
Case 4
If SeqN = 1 Then My1 = Array(0, 1, 2) Else My1 = Array(3, 4)
Case 5
If SeqN = 1 Then My1 = Array(0, 1, 2) Else My1 = Array(3, 4, 5)
Case 6
If SeqN = 1 Then My1 = Array(0, 1, 2, 3) Else My1 = Array(4, 5, 6)
Case 7
If SeqN = 1 Then My1 = Array(0, 1, 2, 3) Else My1 = Array(4, 5, 6, 7)
End Select
For I = LBound(My1, 1) To UBound(My1, 1)
tritt12 = tritt12 & " " & MyTritt(My1(I))
Next I
tritt12 = Trim(tritt12)
End If
End Function
=tritt12(B!A1;1)
=tritt12(B!A1;2)
Function tritt(ByVal StartV, SeqN) As String
Dim MyTritt, newW As String, I As Integer, Blanks As Integer
For I = 1 To Len(StartV)
If Mid(StartV, I, 1) = " " And flacrt Then
newW = newW & Mid(StartV, I, 1): flacrt = False
Else
If Mid(StartV, I, 1) <> " " Then _
newW = newW & Mid(StartV, I, 1): flacrt = True
End If
Next I
MyTritt = Split(Trim(newW), " ")
If (SeqN - 1) > UBound(MyTritt, 1) Then
tritt = ""
Else: tritt = MyTritt(SeqN - 1)
End If
End Function
=tritt(B!A1;1)
=tritt(B!A1;2)
A me invece piace non complicarsi la vita...è che mi piacciono più le formule...
=tritt12(B!A1;1)
=tritt12(B!A1;2)
Function tritt123(ByVal StartV, SeqN) As String
Dim MyTritt, newW As String, I As Integer, Blanks As Integer
Dim My1
For I = 1 To Len(StartV)
If Mid(StartV, I, 1) = " " And flacrt Then
newW = newW & Mid(StartV, I, 1): flacrt = False
Else
If Mid(StartV, I, 1) <> " " Then _
newW = newW & Mid(StartV, I, 1): flacrt = True
End If
Next I
'
MyTritt = Split(UCase(Trim(newW)), " ")
If SeqN > 2 Then
tritt123 = ""
Else:
FirstIt = Int((UBound(MyTritt, 1) + 1) / 2) + ((UBound(MyTritt, 1) + 1) Mod 2) - 1
For I = 0 To UBound(MyTritt, 1)
If I <= FirstIt Then
trittW1 = trittW1 & " " & MyTritt(I)
Else: trittW2 = trittW2 & " " & MyTritt(I)
End If
Next I
'
If SeqN = 1 Then
tritt123 = Trim(trittW1)
Else: tritt123 = Trim(trittW2)
End If
End If
End Function
=tritt123(B!A1;1)
=tritt123(B!A1;2)
=MAIUSC(SE(B!A1="";"";SINISTRA(B!A1;RICERCA("@";SOSTITUISCI(B!A1;" ";"@";INT((LUNGHEZZA(B!A1)-LUNGHEZZA(SOSTITUISCI(B!A1;" ";""))+2)/2)))-1)))
=MAIUSC(SE(A1="";"";STRINGA.ESTRAI(B!A1;RICERCA("@";SOSTITUISCI(B!A1;" ";"@";INT((LUNGHEZZA(B!A1)-LUNGHEZZA(SOSTITUISCI(B!A1;" ";""))+2)/2)))+1;LUNGHEZZA(B!A1))))
=SOSTITUISCI(MAIUSC(B!A1);B1;"")
trittico69 ha scritto:ho risolto con queste due formule
trittico69 ha scritto:=MAIUSC(SE(A1="";"";STRINGA.ESTRAI(B!A1;RICERCA("@";SOSTITUISCI(B!A1;" ";"@";INT((LUNGHEZZA(B!A1)-LUNGHEZZA(SOSTITUISCI(B!A1;" ";""))+2)/2)))+1;LUNGHEZZA(B!A1))))[/code]
=MAIUSC(SE(B!A1="";"";STRINGA.ESTRAI(B!A1;RICERCA("@";SOSTITUISCI(B!A1;" ";"@";INT((LUNGHEZZA(B!A1)-LUNGHEZZA(SOSTITUISCI(B!A1;" ";""))+2)/2)))+1;LUNGHEZZA(B!A1)))
=SE(ANNULLA.SPAZI(B!A1)="";"";SINISTRA(ANNULLA.SPAZI(ANNULLA.SPAZI(B!A1));RICERCA("@";SOSTITUISCI(ANNULLA.SPAZI(B!A1);" ";"@";INT((LUNGHEZZA(ANNULLA.SPAZI(B!A1))-LUNGHEZZA(SOSTITUISCI(ANNULLA.SPAZI(B!A1);" ";""))+2)/2)))-1))
Torna a Applicazioni Office Windows
cerca il più grande numero di celle vuote in un intervallo Autore: papiriof |
Forum: Applicazioni Office Windows Risposte: 2 |
formula che conta erroneamente celle "vuote" Autore: raimea |
Forum: Applicazioni Office Windows Risposte: 4 |
Visitano il forum: Nessuno e 32 ospiti