+ Reply to Thread
Results 1 to 19 of 19

I need a formula to search between two variables

  1. #1
    Registered User
    Join Date
    01-20-2016
    Location
    Lisbon
    MS-Off Ver
    2013
    Posts
    14

    I need a formula to search between two variables

    hoteis.jpg

    I have this output list that has in column A the name of the hotels and in column I the dates of the check out, in the column G you have the rates for that especific date, room, and hotel.

    hoteis2.jpg

    I want to have the lowest value of the column G, to a given hotel and specific date. So in D6 should appear 88 because is the lowest value from Hotel Fenix Lisboa for day 20/01/2016

    I hope you can help, thanks in advance.

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: I need a formula to search between two variables

    Try

    D3=INDEX(Output!$G$2:$G$1000,SMALL(IF(Output!$I$2:$I$1000=Final!$D2,IF(Output!$A$2:$A$1000=Final!C$3,ROW(Output!$B$2:$B$1000)-ROW(Output!$B$1))),ROWS(Final!$C$2:C2))) with CRTL+SIFt+ENTER and drag down.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Registered User
    Join Date
    01-20-2016
    Location
    Lisbon
    MS-Off Ver
    2013
    Posts
    14

    Re: I need a formula to search between two variables

    The formula works fine if I drago right, If I drag down it shows error !NUM

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: I need a formula to search between two variables

    Oopss it just because reference lock

    try

    =INDEX(output!$G$2:$G$1000,SMALL(IF(output!$I$2:$I$1000=final!D$2,IF(output!$A$2:$A$1000=final!$C3,ROW(output!$B$2:$B$1000)-ROW(output!$B$1))),ROWS(final!$C$2:C2))) with CTRL+SHIFT+ENTER

  5. #5
    Registered User
    Join Date
    01-20-2016
    Location
    Lisbon
    MS-Off Ver
    2013
    Posts
    14

    Re: I need a formula to search between two variables

    I changed but the samething happened

  6. #6
    Registered User
    Join Date
    01-20-2016
    Location
    Lisbon
    MS-Off Ver
    2013
    Posts
    14

    Re: I need a formula to search between two variables

    There is any other option?

  7. #7
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: I need a formula to search between two variables

    Can you upload your workbook??

    For uploading workbook go to advance and click on attachment link and attach the workbook

    Thanks Ankur

  8. #8
    Registered User
    Join Date
    01-20-2016
    Location
    Lisbon
    MS-Off Ver
    2013
    Posts
    14

    Re: I need a formula to search between two variables

    Booking Scraper_v2.xlsm

    Thanks in advance!

  9. #9
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: I need a formula to search between two variables

    Try
    D3=IFERROR(INDEX(Output!$G$2:$G$15000,SMALL(IF(Output!$I$2:$I$15000=Final!D$2,IF(TRIM(Output!$A$2:$A$15000)=TRIM(Final!$C3),ROW(Output!$B$2:$B$15000)-ROW(Output!$B$1))),1)),"This date is not in Output Sheet") with CTRL+SHIFT+ENTER

    Ps- If Date is not in output sheet it will show massage, you can change it as you want.

    check the attachment,
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-20-2016
    Location
    Lisbon
    MS-Off Ver
    2013
    Posts
    14

    Re: I need a formula to search between two variables

    Works perfect, thank you very much

  11. #11
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: I need a formula to search between two variables

    Glad to help you. If your problem now solved, please mark thread as solved ( Please see the text below the signature how to do it).

    If you satisfy with my solution please add rep by clicking star * icon left corner on your screen on that post which you help you

  12. #12
    Registered User
    Join Date
    01-20-2016
    Location
    Lisbon
    MS-Off Ver
    2013
    Posts
    14

    Re: I need a formula to search between two variables

    I'm sorry but the formula it's note finding the lowest value. If you look in the output sheet the lowest value for that given hotel at 23/01/2016 is 75 but in the Final sheet shows 78,5

    Booking Scraper_v2 - Copy.xlsm

  13. #13
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: I need a formula to search between two variables

    It seems I did wrong thing previously.....

    Try

    D3=IFERROR(SUBSTITUTE(MIN(IF(Output!$A$2:$A$52=Final!$C3,IF(Output!$I$2:$I$52=Final!D$2,SUBSTITUTE(Output!$G$2:$G$52,",",".")+0))),".",","),"Sem Preço") with CRTL+SHIFT+ENTER

    For confirmation that you did the right key stroke you will see { } before and after you formula....

    Hope this will help you
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    01-20-2016
    Location
    Lisbon
    MS-Off Ver
    2013
    Posts
    14

    Re: I need a formula to search between two variables

    Almost perfect, the only problem is that now I dont get decimal numers. Instead of 78,75 I get 7875

  15. #15
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: I need a formula to search between two variables

    Is you decimal looks like "," or "." ???

  16. #16
    Registered User
    Join Date
    01-20-2016
    Location
    Lisbon
    MS-Off Ver
    2013
    Posts
    14

    Re: I need a formula to search between two variables

    that is the problem, doesnt appear the decimal, so instead of having 75,78 or 75.78 i have 7578

  17. #17
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: I need a formula to search between two variables

    Ok Try

    =IFERROR(MIN(IF(Output!$A$2:$A$52=Final!$C3,IF(Output!$I$2:$I$52=Final!D$2,SUBSTITUTE(Output!$G$2:$G$52,",",".")+0))),"Sem Preço")

  18. #18
    Registered User
    Join Date
    01-20-2016
    Location
    Lisbon
    MS-Off Ver
    2013
    Posts
    14

    Re: I need a formula to search between two variables

    Appears "Sem preço" There is nothing that we can change in the last formula to give me decimal prices? because besides that, the formula works good

  19. #19
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: I need a formula to search between two variables

    I don't know what is happening there.

    but it works for me.

    See the attachment.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA search and assign with variables
    By vio.coman in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-13-2015, 03:49 PM
  2. [SOLVED] using IF(SEARCH with multiple variables
    By khalloran in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 12-02-2014, 11:47 PM
  3. File search 2 variables from combobox
    By ratdogexcel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-20-2014, 08:45 AM
  4. How can I use VLOOKUP to search within a table contains 4 variables
    By medo82006 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2013, 04:11 PM
  5. Search and return value to the left? Variables!
    By Crebsington in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2011, 01:32 PM
  6. ISTEXT or SEARCH function with 2 variables
    By mobycane in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-08-2010, 04:49 AM
  7. search a unique value determined by 2 variables
    By Deci in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-27-2007, 09:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1