Pagina precedente | 1 | Pagina successiva
Vota | Stampa | Notifica email    
Autore

Cerca multiplo con condizioni

Ultimo Aggiornamento: 07/06/2017 17:58
Post: 403
Registrato il: 02/02/2006
Città: ROMA
Età: 52
Utente Senior
2007
OFFLINE
05/06/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

------------------------
Image and video hosting by TinyPic
Post: 403
Registrato il: 02/02/2006
Città: ROMA
Età: 52
Utente Senior
2007
OFFLINE
05/06/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 ?!!!
[Modificato da Mat71 05/06/2017 17:05]

------------------------
Image and video hosting by TinyPic
Post: 1.378
Registrato il: 06/04/2013
Utente Veteran
2010
OFFLINE
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



Domenico
Win 10 - Excel 2016
Post: 404
Registrato il: 02/02/2006
Città: ROMA
Età: 52
Utente Senior
2007
OFFLINE
05/06/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 ?!!!!

------------------------
Image and video hosting by TinyPic
Post: 405
Registrato il: 02/02/2006
Città: ROMA
Età: 52
Utente Senior
2007
OFFLINE
05/06/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

------------------------
Image and video hosting by TinyPic
Post: 406
Registrato il: 02/02/2006
Città: ROMA
Età: 52
Utente Senior
2007
OFFLINE
05/06/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

:(
[Modificato da Mat71 05/06/2017 18:24]

------------------------
Image and video hosting by TinyPic
Post: 1.380
Registrato il: 06/04/2013
Utente Veteran
2010
OFFLINE
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

[Modificato da dodo47 05/06/2017 19:08]
Domenico
Win 10 - Excel 2016
Post: 407
Registrato il: 02/02/2006
Città: ROMA
Età: 52
Utente Senior
2007
OFFLINE
05/06/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

------------------------
Image and video hosting by TinyPic
Post: 408
Registrato il: 02/02/2006
Città: ROMA
Età: 52
Utente Senior
2007
OFFLINE
07/06/2017 08:47

[RISOLTO]
Piccolissima modifica
funziona benissimo
grz ancora

------------------------
Image and video hosting by TinyPic
Post: 409
Registrato il: 02/02/2006
Città: ROMA
Età: 52
Utente Senior
2007
OFFLINE
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

------------------------
Image and video hosting by TinyPic
Post: 410
Registrato il: 02/02/2006
Città: ROMA
Età: 52
Utente Senior
2007
OFFLINE
07/06/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")

------------------------
Image and video hosting by TinyPic
Vota:
Amministra Discussione: | Chiudi | Sposta | Cancella | Modifica | Notifica email Pagina precedente | 1 | Pagina successiva
Nuova Discussione
 | 
Rispondi
Cerca nel forum
Tag discussione
Discussioni Simili   [vedi tutte]
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 15:20. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com