Extract figures above a certain value and transpose data

nadeem001

New Member
Joined
Aug 13, 2016
Messages
7
Good day everyone

I need your urgent assistance...

I have a excel table that has headings in column A and row 1

In the remainder of cells (column b- column z and row 2 - 20) there are values

I need to automate my process with the following steps

1. Identify all cells with Absolute values greater than 100
2. Highlight cells that meet criteria in step 1
3. For each of the highlighted cells I need to create a new table that shows:
3.1 the heading from row 1 in column A
3.2 the heading from the original data column A in column B
3.3 the amount from the highlighted cell in column C

I know my explanation is alittle confusing but will appreciate any feedback, thank you
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Please update your account profile with the version of Excel you are using. The "best" solution often depends on what version you have, with its specific functions available. Also, are you looking for a formula, or a VBA solution?

Here's one possibility I came up with, if you have Excel 365 or Excel 2021:

Book1
ABCDEFGHIJKL
1BananaCherryDonutEggFigGrapeHot DogColumn HeadingsRow HeadingsValue
2Red5CherryYellow101
3Orange6777BananaBlue202
4Yellow10166EggBlue-333
5GreenGrapeBlue1234
6Blue202-3331234DonutViolet234
7Indigo
8Violet234
9
Sheet1
Cell Formulas
RangeFormula
J2:L6J2=LET(nbr,SUMPRODUCT(--(ABS(B2:H8)>100)),arr,IF(ABS(B2:H8)>100,ROW(B2:H8)*100+COLUMN(B2:H8),""),vals,SMALL(arr,SEQUENCE(nbr)),r,INT(vals/100),c,MOD(vals,100),CHOOSE({1,2,3},INDEX(1:1,c),INDEX(A:A,r),INDEX(A1:H8,r,c)))
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:H8Expression=ABS(B2)>100textNO
 
Upvote 0
Thank You for your quick response -
Im 99% sure the version of Excel im running is Office 365 - What is the best way to confirm?

I unfortunately cant get the formula above to work it says there is a error with the let formula

Im indifferent if i use a formula or VBA but basically this is what i require:

Input data
1666437678863.png



Output Data:

1666437702309.png


Thank you again for your assistance
 
Upvote 0
To see what version you have, click on File > Account and it should tell you. As far as the error you're getting, what is it? #NAME, #VALUE, or something else? Or do you just get bad results? If so, what?

I've updated the formula so that it's easier to transport to another sheet. Also, so that it sorts by columns instead of rows:

Book1
ABCDEFGHIJKL
1BananaCherryDonutEggFigGrapeHot DogColumn HeadingsRow HeadingsValue
2Red5-888BananaBlue202
3Orange6777-8CherryYellow101
4Yellow10166CherryGreen5000
5Green5000DonutViolet234
6Blue202-3331234EggBlue-333
7IndigoGrapeBlue1234
8Violet234Hot DogRed-888
9
Sheet1
Cell Formulas
RangeFormula
J2:L8J2=LET(data,Sheet1!A1:H8,comp,IFERROR(--(ABS(data)>100),0),nbr,SUM(comp),arr,IF(comp,COLUMN(data)*100+ROW(data),""),vals,SMALL(arr,SEQUENCE(nbr)),r,MOD(vals,100)-MIN(ROW(data))+1,c,INT(vals/100)-MIN(COLUMN(data))+1,CHOOSE({1,2,3},INDEX(data,1,c),INDEX(data,r,1),INDEX(data,r,c)))
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:H8Expression=ABS(B2)>100textNO


To move the formula to another sheet, just change the Sheet1!A1:H8 reference to the location of the table, Sheet1!A1:Z20 based on your first post. Note that if the bottom row of the table is past row 100, we'll need to tweak the formula a little.
 
Upvote 0
Thank you for your response, I can confirm it is office 365:
1666464710198.png



I still cant get the formula to work - i get the following error:
1666464790493.png


Once again i am truly grateful for your responses and assistance
 
Upvote 0
Very peculiar. You can see that it works on my system. As far as I know, "data" is not a reserved word you can't use for a LET name. However, we can try changing it to something else to see if that helps:

Excel Formula:
=LET(MYdata,Sheet1!A1:H8,comp,IFERROR(--(ABS(MYdata)>100),0),nbr,SUM(comp),arr,IF(comp,COLUMN(MYdata)*100+ROW(MYdata),""),vals,SMALL(arr,SEQUENCE(nbr)),r,MOD(vals,100)-MIN(ROW(MYdata))+1,c,INT(vals/100)-MIN(COLUMN(MYdata))+1,CHOOSE({1,2,3},INDEX(MYdata,1,c),INDEX(MYdata,r,1),INDEX(MYdata,r,c)))
 
Upvote 0
managed to fix the above error- it was just a format issue because my laptop uses colons instead of comma`s

however now im having a different issue, this is the result i am getting:
1666502637441.png

not sure what im doing wrong, also for columns K&L do i paste in the same formula?
 
Upvote 0
Hey Eric

Managed to get the above to work with the following VBA:

Sub TBLines()
'
' TBLines Macro
'

'
Range("E51").Select
Sheets("TB").Select
Range("a2:b2", Range("a" & Rows.Count).End(xlUp)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Summary").Select
EmptyRowAccounts
ActiveSheet.Paste
End Sub
Sub DltCol()
'
' DltCol Macro
'

'
Range("F61").Select
Sheets("TB").Select
Columns("B:B").Select
Selection.Delete Shift:=xlToLeft
End Sub
Sub LoopProcess()

Range("E1").Select
Sheets("TB").Select
Range("b1").Select
Do Until ActiveCell.Value = ""
'REPLACE 100 WITH MATERIALITY

ActiveSheet.Range("$A$1:$I$8").AutoFilter Field:=2, Criteria1:=">=100", _
Operator:=xlOr, Criteria2:="<=-100"
Sheets("Summary").Select
Range("G1").Select
Sheets("TB").Select
Range("B1").Select
Selection.Copy
Sheets("Summary").Select
EmptyRow
ActiveSheet.Paste
TBLines
DltCol

Range("E1").Select
Sheets("TB").Select
Range("b1").Select
ActiveCell.Select

Loop
'
End Sub


Thank you for all your assistance - it is highly appreciated
 
Upvote 0
Solution

Forum statistics

Threads
1,214,657
Messages
6,120,764
Members
448,991
Latest member
Hanakoro

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