Formula to pick out certain numbers.

Eddielion

New Member
Joined
Jun 17, 2005
Messages
37
Hello everyone. I need a formula to look for all the 1's and 2's (A2:J2) and list the corisponding number(A1:J1). My original spreadsheet has 37 numbers. I'm running on a Windows 10 and I think Excel 2013(office 360).
Row 1 A:J are the numbers that it's looking for.
Row 2 A:J is the number of times it found a certain number.
L2:?2 - is the list of numbers(which are in A1:J1) that met the criteria
L2:?2 Can have from 1 to to how ever many numbers it finds.

A1:J1 --- 1 2 3 4 5 6 7 8 9 10
A2:J2 --- 0 1 1 3 2 3 2 2 1 5
L2:?2 --- 2 3 5 7 8 9 (formula to find numbers )
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Ron Coderre

MrExcel MVP
Joined
Jan 14, 2009
Messages
2,316
Using your posted example....I've got two possible solutions, an array-formula, completed by holding CTRL and SHIFT when you press ENTER, and a regular formula. Typically, I can get a regular formula to emulate an array formula with just a little more effort (but not quite in this case)
Array-formula entered in L2 and copied across
Code:
=IFERROR(SMALL(IF(ISNUMBER(MATCH($A$2:$J$2,{1;2},0)),$A$1:$J$1),COLUMNS($A:A)),"")

Regular formula:
Code:
=IFERROR(SMALL(INDEX(ISNUMBER(MATCH($A$2:$J$2,{1;2},0))*$A$1:$J$1,0),COLUMNS($A:A)+
10-SUM(COUNTIF($A$2:$J$2,{1,2}))),"")

Is that something you can work with?
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
51,853
Office Version
  1. 365
Platform
  1. Windows
Here is another option for you. Formula in L2 (standard entry) copied across to U2.

Excel Workbook
ABCDEFGHIJKLMNOPQRSTU
112345678910
20113232215235789
List Values
 

Eddielion

New Member
Joined
Jun 17, 2005
Messages
37
Hello Ron.
Thank you very much. Yes this will work for me, and thank you for the speedy responds.
Eddie
 

Eddielion

New Member
Joined
Jun 17, 2005
Messages
37
Hello Peter.
Thank you for your response also. I appreciate the help. Thank you again.
Eddie
 

Forum statistics

Threads
1,148,291
Messages
5,745,884
Members
423,983
Latest member
blackworx

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
Top