Mat71
00lunedì 5 giugno 2017 15:17
Chi mi aiuta a trovare la formula o funzione da inserire ad un cerca verticale multiplo a piu' condizioni ?
es.
(allego file)
fin quando e' compreso prende la prima riga del dato maggiore
mentre quando e' uguale o minore prende la corrispondente
inserisco il riferimento di colonna e il valore da cercare
spero sia chiaro
cmq sempre ci provo anch'io
vorrei evitare un multiplo SE e cerca ...
grazie
Mat71
00lunedì 5 giugno 2017 17:03
ho fatto la macro ...
Sub Proviamo()
Dim i As Integer
Dim c As Integer
'Dim d As Integer
c = Cells(15, 3).Value
d = Cells(15, 2).Value
For i = c To c
If Cells(33, 2 + c).Value <= d Then Cells(15, 5).Value = Cells(33, 2).Value
If Cells(33, 2 + c).Value < d And Cells(34, 2 + c).Value >= d Then Cells(15, 5).Value = Cells(34, 2).Value
If Cells(34, 2 + c).Value < d And Cells(35, 2 + c).Value >= d Then Cells(15, 5).Value = Cells(35, 2).Value
If Cells(35, 2 + c).Value < d And Cells(36, 2 + c).Value >= d Then Cells(15, 5).Value = Cells(36, 2).Value
If Cells(36, 2 + c).Value < d And Cells(37, 2 + c).Value >= d Then Cells(15, 5).Value = Cells(37, 2).Value
If Cells(37, 2 + c).Value < d And Cells(38, 2 + c).Value >= d Then Cells(15, 5).Value = Cells(38, 2).Value
If Cells(38, 2 + c).Value < d Then Cells(15, 5).Value = Cells(38, 2).Value
Next i
End Sub
...............
si puo' tradurre in function ?!!!
dodo47
00lunedì 5 giugno 2017 17:58
Ciao
prova in E15 (da copiare in J15 e/o trascinare in basso):
matriciale
=INDICE($B$33:$B$38;MAX(SE(($B$33:$F$38=PICCOLO(SE(($C$33:$F$38>=B15)*($C$32:$F$32=C15);$C$33:$F$38);1))*($B$32:$F$32=C15);RIF.RIGA($B$33:$B$38)-RIF.RIGA(B33)+1)))
Credo si possa semplificare, ma tant'è.
saluti
Mat71
00lunedì 5 giugno 2017 17:58
Purtroppo non funziona ...
inserisco i due dati ..colonna e valore ma va in errore
Public Function Risultato(Colonna, Valore) As Integer
If Cells(33, 2 + Colonna).value <= Valore Then Risultato = Cells(33, 2).value
If Cells(33, 2 + Colonna).value < Valore And Cells(34, 2 + Colonna).value >= Valore Then Risultato = Cells(34, 2).value
If Cells(34, 2 + Colonna).value < Valore And Cells(35, 2 + Colonna).value >= Valore Then Risultato = Cells(35, 2).value
If Cells(35, 2 + Colonna).value < Valore And Cells(36, 2 + Colonna).value >= Valore Then Risultato = Cells(36, 2).value
If Cells(36, 2 + Colonna).value < Valore And Cells(37, 2 + Colonna).value >= Valore Then Risultato = Cells(37, 2).value
If Cells(37, 2 + Colonna).value < Valore And Cells(38, 2 + Colonna).value >= Valore Then Risultato = Cells(38, 2).value
If Cells(38, 2 + Colonna).value < Valore Then Risultato = Cells(38, 2).value
End Function
dove sbaglio ?!!!!
Mat71
00lunedì 5 giugno 2017 18:02
Re:
dodo47, 05/06/2017 17.58:
Ciao
prova in E15 (da copiare in J15 e/o trascinare in basso):
matriciale
=INDICE($B$33:$B$38;MAX(SE(($B$33:$F$38=PICCOLO(SE(($C$33:$F$38>=B15)*($C$32:$F$32=C15);$C$33:$F$38);1))*($B$32:$F$32=C15);RIF.RIGA($B$33:$B$38)-RIF.RIGA(B33)+1)))
Credo si possa semplificare, ma tant'è.
saluti
L'ho inserita come matrice , sembra funzionare
ti aggiorno su piu' dati
grazie
Mat71
00lunedì 5 giugno 2017 18:21
Re:
dodo47, 05/06/2017 17.58:
Ciao
prova in E15 (da copiare in J15 e/o trascinare in basso):
matriciale
=INDICE($B$33:$B$38;MAX(SE(($B$33:$F$38=PICCOLO(SE(($C$33:$F$38>=B15)*($C$32:$F$32=C15);$C$33:$F$38);1))*($B$32:$F$32=C15);RIF.RIGA($B$33:$B$38)-RIF.RIGA(B33)+1)))
Credo si possa semplificare, ma tant'è.
saluti
ho provato ad inserire un valore maggiore di 6 prima colonna
mi va in errore
#NUM!
invece deve mettere Tipo F
:(
dodo47
00lunedì 5 giugno 2017 19:03
ciao
scusa, ma se non trova il numero più alto nella colonna e deve prendere l'ultima lettera di B33:B38, la lettera è sempre F per tutte le colonne no?
inserisci un se.errore il cui risultato sarà: ...;"F")
saluti
Mat71
00lunedì 5 giugno 2017 19:52
Re:
dodo47, 05/06/2017 19.03:
ciao
scusa, ma se non trova il numero più alto nella colonna e deve prendere l'ultima lettera di B33:B38, la lettera è sempre F per tutte le colonne no?
inserisci un se.errore il cui risultato sarà: ...;"F")
saluti
Avevo pensato la stessa cosa ... si
grazie ancora
Mat71
00mercoledì 7 giugno 2017 08:47
[RISOLTO]
Piccolissima modifica
funziona benissimo
grz ancora
Mat71
00mercoledì 7 giugno 2017 17:52
... dove sbaglio ?
CERCA.VERT($M7;K7&"$B$2:$K$200";5;FALSO)
K7 = nome del foglio ... mi serve dinamico
grz
Mat71
00mercoledì 7 giugno 2017 17:58
Re:
Mat71, 07/06/2017 17.52:
... dove sbaglio ?
CERCA.VERT($M7;K7&"$B$2:$K$200";5;FALSO)
K7 = nome del foglio ... mi serve dinamico
grz
[RISOLTO]
INDIRETTO(K7&"$B$2:$K$200")