Forum Discussion

JMG_1981's avatar
JMG_1981
Copper Contributor
Jan 13, 2023
Solved

Excel Formula to Search a Field in a Table Using If Condition and Procv or Procx

Hell!

 

I have the following problem. I want to buid a formula that give me the Hospital of a user in a table where the data of consultation field has to be >=Data1 and <= Data2 according to the user code. For example: the user code who had a consultation in 14-07-1981,in the hospital16. Wich formula to use to find that the hospital was hospital 16, using the User Code and the Date of Consultation? Can you Help me?

 

Thank you for your help!

 

Best regardes,

 

Joaquim Guedes

 

 

 

 

 

 

  • JMG_1981 

    =ÍNDICE($D$3:$D$19;CORRESP(1;(F3=$A$3:$A$19)*(G3>=$B$3:$B$19)*(G3<=$C$3:$C$19);0))

     

    You are welcome. Unfortunately i only gave you the english translation of the formula. This time i've translated the formula into portuguese.

4 Replies

  • JMG_1981 

    =INDEX($D$3:$D$19,MATCH(1,(F3=$A$3:$A$19)*(G3>=$B$3:$B$19)*(G3<=$C$3:$C$19),0))

    You can try this formula. Enter the formula with ctrl+shift+enter if you don't work with Office 365 or Excel 2021.

     

    • JMG_1981's avatar
      JMG_1981
      Copper Contributor

      Hello OliverScheurich! Thank for your greatreply! I have the following error:

       

      I think Its because my version of Office 2109 is in portuguese! How can I turn this around?

       

      Best regards,

       

      Joaquim Guedes

      • OliverScheurich's avatar
        OliverScheurich
        Gold Contributor

        JMG_1981 

        =ÍNDICE($D$3:$D$19;CORRESP(1;(F3=$A$3:$A$19)*(G3>=$B$3:$B$19)*(G3<=$C$3:$C$19);0))

         

        You are welcome. Unfortunately i only gave you the english translation of the formula. This time i've translated the formula into portuguese.

Resources