+ Reply to Thread
Results 1 to 10 of 10

Can we use Priority while using Single/Multiple Lookup with Multiple Criterions.

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Can we use Priority while using Single/Multiple Lookup with Multiple Criterions.

    Dear Forum,

    My teenager cousin plays a game FarmVille on Facebook, a wonderful game of great imagination and creativity.

    He needs my help in deciding which crop should he go for in different time-slots..Now there are different slots such as these :
    Harvesting Time
    2 Hours
    4 Hours
    6 Hours
    8 Hours
    10 Hours
    12 Hours
    16 Hours
    1 Day
    2 Days
    3 Days
    4 Days

    and in each time-slot different crops can be grown which can help one earn Some Cash which can help you buy things on your farm and Some XP i.e Points to go the next level.

    Now both are important i.e. Sand Dollars as well as XP but then I need help in understanding which crop to go for in a given time-frame..

    Please find the attachment. Sorry but my nets damn slow..so wud attach the file when my nets up....
    Attached Files Attached Files
    Last edited by e4excel; 03-22-2010 at 12:04 PM.

  2. #2
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Single/Multiple Lookup with Multiple Criterions.

    I came up with this code but still not gettting the desired result:

    INDEX('FarmVille Crops'!$C$2:$L$33,SUMPRODUCT(--('FarmVille Crops'!$F$2:$F$34=$C2)*('FarmVille Crops'!$J$2:$J$34=MAX(('FarmVille Crops'!$J$2:$J$34)*('FarmVille Crops'!$F$2:$F$34=$C2))*('FarmVille Crops'!$G$2:$G$34=MAX(('FarmVille Crops'!$G$2:$G$34)*('FarmVille Crops'!$F$2:$F$34=$C2)))),ROW('FarmVille Crops'!$J$2:$J$34))-1,1)


    The problems of giving priority to XP over SanD Dollars..

    If i have two Crops with the same profit but one has more XP than the other than naturally the one with the XP would get selected however if the XP is more and theres minor difference in the Sand Dollars then too I want the XP to be given more preference.

    In short can we change the priority dynamically in Multiple Lookup Logic?
    Please advise...
    I have developed this code after a long time as I have always admired the way the gurus have helped me ..

    I am really thankful to DaddyLOnglegs,DonketOte,Vane,Shg etc and many more from whom I have got to learn so much..

  3. #3
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Can we use Priority while using Single/Multiple Lookup with Multiple Criterions.

    G'day

    Does this help ? See attachment
    Attached Files Attached Files
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Can we use Priority while using Single/Multiple Lookup with Multiple Criterions.

    Dear RatCat,

    Yes it does but can u also explain how it works?
    Just by Concatenating 11&" "&@ Hours.. Amazing Stuff..

    As I also thought of one more thing after I treid my own code as you must have seen the same.

    I wanted to give more preference to XP Earned over SandDollars and also maybe keep it floating of possible to intechange between the two
    i.e. XP or Sand Dollars so the code should act differently in case of a TIE or if the XP Earned is less and the Profit is More .

    I shall try can dome back with the same.

    Thanks a lot..

  5. #5
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Can we use Priority while using Single/Multiple Lookup with Multiple Criterions.

    Quote Originally Posted by e4excel View Post
    ......
    Yes it does but can u also explain how it works?
    Just by Concatenating 11&" "&2 Hours.. Amazing Stuff..
    ..........
    I've done that to match the unique words in 'FarmVille Crops' Col O. Btw it was late at night and with further testing of that formula worked out is not for you.

    (For me anyway) Instead of making a long Sumproduct that I and/or we are going to get lost in I decided to breakdown the information into separate sheets.

    Then in Col N on each time sheet you can adjust the higher ranking to your choice out of 4 variants. Eg your number one choice in ranking will be multiple by 1000 then the second ranking will be multiple by 100 etc etc.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Can we use Priority while using Single/Multiple Lookup with Multiple Criterions.

    Dear RaTCat,

    I will take a while before I get the complete logic absorbed..
    I shall come back after that but I must say you really have taken a lot of efforts ( really appreciate that !)

    DID u also get the new requirement of keeping the preference of XP over Sand Dollars Dynamic?

    I am trying real hard but not able to come up with a good logic yet!

    Thanks a lot...

  7. #7
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Can we use Priority while using Single/Multiple Lookup with Multiple Criterions.

    Wow,

    It worked very well RatCat, must say that this approach is much more simpler than sumproduct howeer it adds to the number of Sheets which is cause of concern as this is more to do with a game.

    And I would also like to know whether the Preferences cans be changed dynamically?

  8. #8
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Can we use Priority while using Single/Multiple Lookup with Multiple Criterions.

    G'day

    I changed a few things for your 'dynamic preferences' tho unsure of what layout result your looking for but there is an example attached.

    There is a drop down box (Data Validation) at the Harvesting Time. So just select the time for what your looking.

    Cheers

    RC
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Can we use Priority while using Single/Multiple Lookup with Multiple Criterions.

    Wow this is great,,

    More compact and reobust but what I was talking about was a little complex..

    See now in the same example if i want to give the preference to XP so Incase if there's a crop which has more XP abut less Sand Dollars than the second best should be selected as depending on the situation you want to move to the next level in the game whereas if you neeed to buy something you would need more Sand Dollars.

    I think your codes excellent and it works brilliantly so no more requirement..Thanks alot again God Bless..!

  10. #10
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Can we use Priority while using Single/Multiple Lookup with Multiple Criterions.

    Thank you for the blessing.

    I like to ask if you, please bless the thread as solved. If you can not bless the thread please PM a Mod to solve the thread for you.

    Cheers

    RC

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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