+ Reply to Thread
Results 1 to 12 of 12

Returning value based on search criteria

  1. #1
    Registered User
    Join Date
    07-27-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    17

    Returning value based on search criteria

    Hey all,

    Hoping to get some direction which will be most appreciated.

    Working on an interactive sheet to calculate what options of batteries would be required to suit application (Amps output for either 24V or 48V). Options for these battery sizes would vary from 2V to 12V, and based on total AMPS previously calculated in the sheet, would like to highlight best option (closest Amps, not price) based on this information. eg. 24V system would need 12 of 2V batteries, 48V system would require 24 of 2V batteries (Amps remain the same).

    Would sort all batteries by individual specifications (with single unit pricing) and want to somehow output details with BRAND, TYPE, TOTAL VOLTS, UNITS REQ and TOTAL PRICE for units req.


    Please Login or Register  to view this content.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Returning value based on search criteria

    Please attach a sample workbook with expected output for better understanding


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    07-27-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Returning value based on search criteria

    You are quite right, see attached.

    Lightly coloured areas are where the user would input data, and final figure is located in green box (calculations sheet).

    Would like to calculate total options of batteries (Batteries sheet) based on Voltage from cell (R8 will always be 24V or 48V) with maybe highlighting the row that best matches the size of Amps.

    Hope this helps.


    Battery sizing.xlsx
    Last edited by kolonel; 04-17-2013 at 12:14 AM. Reason: edit

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Returning value based on search criteria

    Sorry to say that I am still unable to understand what needs to be done and how since it is a new terminology for me and I am unable to get your point what you are looking to do

  5. #5
    Registered User
    Join Date
    07-27-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Returning value based on search criteria

    No need to apologise.

    What i am wanting to be able to do is as follows:

    • After the user inputs the information on the Calculations sheet, they will come to a final result which is located in the green cell R21.
    • From this output, i want to be able to search/scan column B on the Batteries sheet and highlight the closest match to this number and output it into the Orange area on the highlighted area on the Calulations sheet.

    Hope this makes sense

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Returning value based on search criteria

    Check this logic and confirm whether we can go with it and get the rest of the details based on this logic

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-27-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Returning value based on search criteria

    Thank you for the response Sixthsense.

    Sadly did not work, and returns a #N/A result when pasted in the cell.

    Regards
    Rob

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Returning value based on search criteria

    Try this...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Ensure that the cell R21 should populate some value.

  9. #9
    Registered User
    Join Date
    07-27-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Returning value based on search criteria

    Hmm, now getting ERR:508 which i am led to believe is an error in bracketing, but i cant see it !!

    =IF(LOOKUP(Calculations!R21,Batteries!B:B,Batteries!B:B)=Calculations!R21,LOOKUP(Calculations!R21,Batteries!B:B,Batteries!B:B),INDEX(B:B,MATCH(LOOKUP(Calculations!R21,Batteries!B:B,Batteries!B:B),B:B,0)+1))

  10. #10
    Registered User
    Join Date
    07-27-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Returning value based on search criteria

    Quote Originally Posted by kolonel View Post
    Hmm, now getting ERR:508 which i am led to believe is an error in bracketing, but i cant see it !!

    =IF(LOOKUP(Calculations!R21,Batteries!B:B,Batteries!B:B)=Calculations!R21,LOOKUP(Calculations!R21,Batteries!B:B,Batteries!B:B),INDEX(B:B,MATCH(LOOKUP(Calculations!R21,Batteries!B:B,Batteries!B:B),B:B,0)+1))
    Can anyone see anything wrong with the above formula?

    Regards
    Rob

  11. #11
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Returning value based on search criteria

    Hello,

    Are you looking for something like this?
    Battery sizing.xlsx
    (copy pasta from Ford)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools

    Regards,
    Lem

  12. #12
    Registered User
    Join Date
    07-27-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Returning value based on search criteria

    Quote Originally Posted by Lemice View Post
    Hello,

    Are you looking for something like this?
    Thank you Lemice, this is a perfect start.

+ 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