Retrieve X and Y value from table

bobpijnenburg

New Member
Joined
Jun 1, 2015
Messages
4
Dear all,

I have a question if there is a function in excel that can help me out. I try to explain my situation as clear as possible.

I have to retrieve the values of the X and Y component of a table where the value is equal to a specific value. I give an explanation:

y=2x+112345678910
13579111315171921
246810121416182022
357911131517192123
4681012141618202224
5791113151719212325
68101214161820222426
79111315171921232527
810121416182022242628
911131517192123252729
1012141618202224262830

<tbody>
</tbody>

From this table give the x and the y component of the values that are equal to 13, and that, if possible, in a neat list. Is that possible?

Thanks in advance for your time,

Kind regards,

Bob
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hello,

Assuming y=2x+1 is in cell A1.

If you enter 13 into cell A13, then run the macro

Code:
Sub FIND_COMPONENTS()
    For MY_COL = 2 To Cells(2, Columns.Count).End(xlToLeft).Column
        For MY_ROW = 2 To Range("K" & Rows.Count).End(xlUp).Row
            If Cells(MY_ROW, MY_COL).Value = Range("A13").Value Then
                Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = _
                    "X = " & Cells(1, MY_COL).Value & "; Y = " & Cells(MY_ROW, 1).Value
            End If
        Next MY_ROW
    Next MY_COL
End Sub

You haven't specified what you want to do with the data after it has been found.

Is this what you expect?
 
Upvote 0
Hi onlyadrafter,

Thank you very much, exactly what I needed! Hoped that this might be a standard function in Excel, but this works perfectly.

Have a nice day and thanks for your time.

Kind regards,

Bob
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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