+ Reply to Thread
Results 1 to 5 of 5

Indicate Pairs based on Given %

  1. #1
    Registered User
    Join Date
    11-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Indicate Pairs based on Given %

    Hi there,

    I am putting together a battery log that keeps track of battery capacity in percentages. The goal is to pair two batteries with the closest percentages together. As you will see in the attached sheet, I have indicated those pairs with asterisks (*). Is there a way for the sheet to indicate pairs automatically? I am not sure how it would display, but I was thinking that it could indicate pairs by cell colour perhaps? I am open to ideas and look forward to hearing your solution!

    * AliGW has solved the above for which I'm grateful. I should have noted earlier that an odd number of batteries may be logged in which case one battery can not be paired. One solution brings forward another problem, so it seems! I would not mind if the one odd battery gets displayed a blank cell. I will be tinkering with it in the meantime.
    Attached Files Attached Files
    Last edited by Platak; 10-09-2021 at 06:02 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,893

    Re: Indicate Pairs based on Given %

    How about this in H2 copied down:

    =REPT("*",LOOKUP(RANK(G2,$G$2:$G$9,0),{1,3,5,7,9},{1,2,3,4,5}))

    Administrative Note

    Members will often tailor the solutions they offer to the version of Office (Excel) that you have. Please check that your forum profile is up-to-date in this respect. Thanks.
    Attached Files Attached Files
    Last edited by AliGW; 10-09-2021 at 06:08 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Indicate Pairs based on Given %

    Thanks AliGW,

    This is definitely a solution that works! A few remarks:

    - I have added an IF statement as to not display the '#VALUE!' in the H cells. That is about the extend of my Excel skills!

    - Is there a function that will work with an odd amount of inputs? This seems picky, but there is a good chance that I will have an odd number of batteries after which the following 'error' will present itself: when inputting the following values, it will pair F3 and F4 while it should pair F2 and F3 as they remain the closest in percentages.

    '2400' in F2.
    '2410' in F3.
    '2500' in F4.

    I have attached this example.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,893

    Re: Indicate Pairs based on Given %

    You’ve just shifted the goalposts significantly. You’ll have to wait for someone with a different approach. Sorry.

  5. #5
    Registered User
    Join Date
    11-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Indicate Pairs based on Given %

    I really appreciate the changes you made to the log. It is very usable now and will be using it with the battery data I have so far. Very happy with it!

    Also, I noticed that it only pairs incorrectly when the odd one out has a higher capacity.

    2450 *
    2450 *
    2500 *

    2450 *
    2450 *
    2400 **

    ------------

    2450 **
    2460 *
    2500 *

    2450 *
    2460 *
    2400 **
    Last edited by Platak; 10-09-2021 at 06:08 PM.

+ 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] Matching pairs based on criteria
    By chrisellis250 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2021, 02:42 PM
  2. detect only the two pairs of twin pairs within the 7 positions.
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-13-2020, 07:54 AM
  3. [SOLVED] 137/5000 detect at the value = 1 for pairs, 2 odd pairs and 3 for the same digit
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-29-2020, 10:20 PM
  4. Replies: 7
    Last Post: 10-17-2019, 12:00 PM
  5. Replies: 1
    Last Post: 08-19-2019, 08:38 AM
  6. convert the sweepstakes to their palindrome pairs and identify the twin pairs.
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2019, 07:59 AM
  7. Replace values based on from-to pairs
    By sugargenius in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2018, 08:23 PM

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