Forum Discussion

cRokitski's avatar
cRokitski
Tin Contributor
Dec 01, 2026

Find min value from Row A, use it to find value in Row B in same col, and output value into a cell

I am building a price sheet for a construction project. I have a tab for each trade (concrete, mason, drywall, etc...). I want one cell to quickly output the lowest bidder for that trade.

 

In the screen shot, I want to output a price in the Blue cell. Technically, this will be on a different tab, but trying to make it easy for this question.

I want to find the lowest price in green (which is the base bid price), then use that price to find associated price in the yellow row. This will be the lowest bidder's alternate price, which may or may not be the lowest yellow price.

 

In this scenario, the result would be: $50 is the lowest green price, so the yellow price is $75.

 

The blue cell will show $75.

 

I also want to ignore $0.00 from the columns without prices. 

 

9 Replies

  • Terio's avatar
    Terio
    Brass Contributor

    As m_tarler​ (hi) said, you just need to shift the row of values ​​to be retrieved one cell to the right.

    Bye

  • cRokitski's avatar
    cRokitski
    Tin Contributor

    Thanks Terio​ and AndreasKiller​ 

    I can get your two formulas to work, however after trying it on my actual sheet, I noticed I have a slight difference that affects it. In the new screenshot, I have merged cells and non-merged cells. If the second row (yellow) has data in the right part of the merged area, the formulas don't work, but they do work if the data is on the left side. I can see why as the top merged cell is based on the left side, not the right. So, the formulas are looking for matching info on the left side, not the right side. 

    Is there a way to tweak the formula to make the top version work?

    • m_tarler's avatar
      m_tarler
      Silver Contributor

      You just need to offset the in and the out.  So AndreasKiller​ formula would look like:

      A8: =XLOOKUP(MINIFS(A1:Y1,A1:Y1,">0"),A1:Y1,B5:Z5)

      so the MINIFS and the Lookup range are both set to columns A:Y but the return range is B:Z

      and Terio​ formula would look like this:

      =LET(d,A1:Z1,SUM(IF(MIN(IF(d,d))=d,B5:AA5)))

      again, I just shifted the output from originally A5:Z5 to now be B5:AA5

    • SnowMan55's avatar
      SnowMan55
      Bronze Contributor

      A formula such as this can be used:

      =LET( smallest_NZ_value, MINIFS(A1:Z1, A1:Z1, "<>0"),
          col_num_with_smallest, XMATCH(smallest_NZ_value, A1:Z1),
          adjusted_col_num, col_num_with_smallest + 1,
          INDEX(A3:Z3, 1, adjusted_col_num)
      )

      I will try to attach a workbook that demonstrates it and includes more information.

  • cRokitski's avatar
    cRokitski
    Tin Contributor

    Terio​ AndreasKiller​ 

    Thanks, I can both of them to work in a normal situation. While trying to make it work in my sheet, I noticed something that I need to add.
    In the screenshot, I have merged cells (green), and the Yellow is not merged. 
    My scenario is like the top, with the yellow cells on the right part of the merged data. However, I can only get your formula to work if the yellow is on the left. 
    My sheet/data won't work if I move the yellow to the right, so is there a way to modify your formula to grab the info that on the left part of the merged data (as seen on the bottom half of the screenshot)? 

    • AndreasKiller's avatar
      AndreasKiller
      Tin Contributor

      cRokitski​ 

      A8: =LET(p,MATCH(MINIFS(A1:Z1,A1:Z1,">0"),A1:Z1,0), MIN(OFFSET(A5,0,p-1,,2)))

      A brief explanation of how it works:

      Merged cells are an optical illusion. The value in the cell is always located in the top-left cell of all merged cells.

      Therefore, the position "p" is either 1, 3, or 5, corresponding to columns A, C, or E.

      We search the range A1:Z1 and can return the two values ​​from row 5 using the OFFSET function. Since we start at A5, we need to subtract 1 from the position. We then use MIN to obtain the smallest value.

      This means that a value can be present in both cells below or in only one cell, and the smallest value is always returned.

      Do you have anymore questions?

      Andreas.

  • Terio's avatar
    Terio
    Brass Contributor

    A variant:

    =LET(d,A1:Z1,SUM(IF(MIN(IF(d,d))=d,A5:Z5)))


    Bye