Formula to find first occurrence between 2 values in an unsorted array

jnurella

New Member
Joined
Mar 30, 2019
Messages
5
Hello,
I'm looking for a formula that goes in each row of column P that finds which number shows up first (between columns M and N) in the unsorted array (A through K). I have pasted the results I'm looking for in column P....For example, in Row 2 the formula should look for whether 54.3% or 0% shows up first in the array from A2 to K2...the answer is 54.3%... see image below for spreadsheet

<a href="http://www.freeimagehosting.net/commercial-photography/"><img src="https://i.imgur.com/BRy2c3T.jpg" alt="Commercial Photography"></a>
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi & welcome to MrExcel
How about
=IFERROR(INDEX(A2:K2,MIN(IFERROR(MATCH(M2,A2:K2,0),99),IFERROR(MATCH(N2,A2:K2,0),99))),"Neither")
 
Upvote 0
Try

<b>sheet</b><br /><br /><table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:55px;" /><col style="width:55px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >P</td><td >Q</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td >none</td><td > </td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b></b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >P2</td><td >=IFERROR(IF(MATCH(M2,A2:K2,0)<MATCH(N2,A2:K2,0),M2,N2),"none")</td></tr></table></td></tr></table> <br /><br />
<match(n2,a2:k2,0),m2,n2),"none")[ quote]<="" html=""></match(n2,a2:k2,0),m2,n2),"none")[>
 
Last edited:
Upvote 0
Hi & welcome to MrExcel
How about
=IFERROR(INDEX(A2:K2,MIN(IFERROR(MATCH(M2,A2:K2,0),99),IFERROR(MATCH(N2,A2:K2,0),99))),"Neither")

Thanks for responding. I tried this on P2 but I get "0". I.m looking for 54.3% in P2... -82.67% in P3...etc
 
Upvote 0
Try

sheet

PQ
none

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:55px;"><col style="width:55px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]

</tbody>

CellFormula
P2=IFERROR(IF(MATCH(M2,A2:K2,0)<MATCH(N2,A2:K2,0),M2,N2),"none")

<tbody>
</tbody>

<tbody>
</tbody>



<match(n2,a2:k2,0),m2,n2),"none")[ quote]<="" html=""></match(n2,a2:k2,0),m2,n2),"none")[>

DanteAmor - same issue with your formula. I get "none" as result....I'm actually looking for which of the 2 numbers (in Column M or N) appears first...
 
Upvote 0
how many decimals do you have in M and N; ​​and how many decimals do you use in range A to K?
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,143
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top