+ Reply to Thread
Results 1 to 12 of 12

How to return value from another column after using Min / IF calculation

Hybrid View

  1. #1
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    How to return value from another column after using Min / IF calculation

    Hi All,

    I have a formula where I wish to locate the minimum or cheapest rate available to us per below:

    =MIN(IF(Rates!$A$6:$A$145=Calculator!$D$6,IF(Rates!$D$4:$S$4=Calculator!$D$12,IF(Rates!$D$5:$S$5=Calculator!$D$14,Rates!$D$6:$S$145))))

    This works fine and returns the value I require, however in another cell I also need it to tell me the carrier which is in column C of the same 'Rates' Sheet that corresponds with this lowest or cheapest value.


    Thanks,
    Gaz

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to return value from another column after using Min / IF calculation

    With your result for the minimum in B2, try
    Formula: copy to clipboard
    =INDEX($C$6:$C$145,SUMPRODUCT((D6:$S$145=B2)*(ROW(D6:D145)))-ROW(D6)+1)

    This assumes that only one minimum rate exists. You might want to check that with an IF, something like
    Formula: copy to clipboard
    =IF(COUNTIF(D6:$S$145, B2)>1, “Duplicate Values”, INDEX($C$6:$C$145,SUMPRODUCT((D6:$S$145=B2)*(ROW(D6:D145)))-ROW(D6)+1))
    Last edited by ChemistB; 03-19-2019 at 11:30 AM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    Re: How to return value from another column after using Min / IF calculation

    Hi, unfortunately I can't seem to get this to work.

    My result is in cell D24 and so I have the below adapted from your response:

    =INDEX(Rates!$C$6:$C$145,SUMPRODUCT(Rates!$D$6:$S$145=Calculator!$D$24)*(ROW(Rates!$D$6:$D$145)))-ROW(Rates!$D$6)+1

    Thanks,
    Gaz

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to return value from another column after using Min / IF calculation

    Hard to say without an uploaded example but try
    Formula: copy to clipboard
    =INDEX(Rates!$C$6:$C$145,SUMPRODUCT(Rates!$D$6:$S$145=Calculator!$D$24)*(ROW(Rates!$D$6:$D$145))-ROW(Rates!$D$6)+1)

  5. #5
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    Re: How to return value from another column after using Min / IF calculation

    Hi, hopefully this might help! Cell concerned is highlighted in yellow (D22)

    Thanks
    Gaz
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to return value from another column after using Min / IF calculation

    First issue is you have some #Value errors in your table. Clear those out.
    To find them try F5> Special > Constants> Errors> Find next

    Then the formula
    Formula: copy to clipboard
    =INDEX(Rates!$C$6:$C$145,SUMPRODUCT((Rates!$D$6:$S$145=Calculator!$D$24)*(ROW(Rates!$D$6:$S$145)))-ROW($D$6)+1)

    in D6 works

  7. #7
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    Re: How to return value from another column after using Min / IF calculation

    Hi, I've cleared the errors and entered the formula which is returning a result, however it appears to constantly be carrier A no matter what the other parameters which incidentally is the value in C6?


    Thanks,
    Gaz

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to return value from another column after using Min / IF calculation

    Sorry, here’s the formula for D22


    Formula: copy to clipboard
    =INDEX(Rates!$C$6:$C$145,SUMPRODUCT((Rates!$D$6:$S$145=Calculator!$D$24)*(ROW(Rates!$D$6:$D$145)-ROW(Rates!$D$6)+1)))

    See attached.

  9. #9
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    Re: How to return value from another column after using Min / IF calculation

    Thanks, although I guess I am also getting further problems because not all the values are unique and so it is returning #REF! results on some lanes?

    Regards,
    Gaz

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to return value from another column after using Min / IF calculation

    Yes, my approach will only work with unique values. I'll think on it.

  11. #11
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    Re: How to return value from another column after using Min / IF calculation

    Hi there, did you have any luck with this?

    Thanks,
    Gaz

  12. #12
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: How to return value from another column after using Min / IF calculation

    Assuming

    a) you're on O365 {per profile}
    b) you've removed the #VALUE! errors
    c) you want to return all Carriers that meet the criterion {Destination, Region, Size & Cheapest Rate}

    Formula: copy to clipboard
    D22:
    =TEXTJOIN(";",TRUE,INDEX(REPT(Rates!$C$6:$C$145,SIGN((Rates!$A$6:$A$145=$D$6)*(Rates!$D$4:$S$4=Calculator!$D$12)*(Rates!$D$5:$S$5=Calculator!$D$14)*(Rates!$D$6:$S$145=Calculator!$D$24))),0))

    above would return A based on the earlier sample, but if you were to copy Rates!K14 to K16 you would then get A;C

    however, I suspect the above is over-engineered for what you really need...

+ 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. Replies: 1
    Last Post: 09-24-2013, 03:03 AM
  2. Replies: 1
    Last Post: 09-24-2013, 02:06 AM
  3. If A calculation is less than X return zero
    By p911pew in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-23-2013, 02:27 PM
  4. Replies: 1
    Last Post: 02-12-2013, 06:02 PM
  5. Replies: 1
    Last Post: 01-15-2013, 08:51 AM
  6. Return on investment calculation
    By screamingfingers in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-14-2013, 09:14 PM
  7. [SOLVED] return calculation every four weeks
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 05-11-2006, 07:20 AM

Tags for this Thread

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