to convert suits into mirrors as per table

piter

Active Member
Joined
Jul 22, 2011
Messages
314
Office Version
  1. 2016
Platform
  1. Windows
to convert suits into mirrors as per table
table=
0 1 2 3 4
5 6 7 8 9
example
75 the macro will see by the table
5 vale = 7 vale 2 and 5 vale 0 therefore = the pair mirror = 20
has to be guided by the table.
if you have 9 it's mirror 4 and the other way around
if you have 4 the mirror is 9
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Maybe this?

Code:
Function CV(r As range)

Dim orig, repl
Dim a As String, b As String
Dim i As Integer

orig = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".")
repl = Array("5", "6", "7", "8", "9", "0", "1", "2", "3", "4", ".")

For i = 1 To Len(r)
    a = a & repl(Application.Match(Mid(r, i, 1), orig, 0) - 1)
Next

CV = a

End Function
 
Upvote 0
Is the mirror table static?


Book1
ABCDEFG
5256079701524
6456079901524
7135864680319
8305864850319
Planilha1
Cell Formulas
RangeFormula
E5=MOD(INT(A5/10)+5,10)*10+MOD(MOD(A5,10)+5,10)


WBD
 
Upvote 0
If it's not static then it's a trickier problem:


Book1
ABCDEFGHIJKLMN
525607970152401234
645607990152456789
7135864680319
8305864850319
Planilha1
Cell Formulas
RangeFormula
E5{=INDEX($J$5:$N$6,ROW($J$7)-MIN(IF($J$5:$N$6=INT(A5/10),ROW($J$5:$N$6))),MIN(IF($J$5:$N$6=INT(A5/10),COLUMN($J$5:$N$6)-COLUMN($I$5))))*10+INDEX($J$5:$N$6,ROW($J$7)-MIN(IF($J$5:$N$6=MOD(A5,10),ROW($J$5:$N$6))),MIN(IF($J$5:$N$6=MOD(A5,10),COLUMN($J$5:$N$6)-COLUMN($I$5))))}
Press CTRL+SHIFT+ENTER to enter array formulas.


WBD
 
Upvote 0
Hello, thanks, steve and wide can put in the planilla and activate and put in attachment? Please, thank you for the hard work.
 
Upvote 0
hello wide yes, yes Is the mirror table static! fix
 
Upvote 0
Sorry. I have you two solutions and all you have to do is put this formula into E5:

Code:
=MOD(INT(A5/10)+5,10)*10+MOD(MOD(A5,10)+5,10)

Then copy the formula across and down. I'm not messing around putting formulas in sheets and uploading them for you.

WBD
 
Upvote 0

Forum statistics

Threads
1,215,214
Messages
6,123,660
Members
449,114
Latest member
aides

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