# Excel Binary GCD Finder

Page 1 of 1

## 0 Replies - 1432 Views - Last Post: 25 February 2013 - 04:55 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=313511&amp;s=ec218ceeb6c858f55b3d9e9e92e0770c&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 keepitsimple

Reputation: 0
• Posts: 1
• Joined: 25-February 13

# Excel Binary GCD Finder

Posted 25 February 2013 - 04:55 PM

I just invented the "Excel Binary GCD Finder"
http://en.wikipedia....y_gcd_algorithm
A1 Number 1
B1 Number 2
C1 =((IF(GCD(2,A1)>1,1,0)+IF(GCD(B1,2)>1,2,0)))
D1 =IF(C1=3,1,0)
E1 =IF(A1=B1,A1*(2^D1),"NOT YET")

A2 =IF(IF(C1=3,A1/2),IF(C1=2,A1),IF(C1=1,(A1/2),ABS((A1-B1)/2)))
B2 =IF(IF(C1=3,B1/2),IF(C1=2,B1/2),IF(C1=1,(B1),MIN(A1,B1)))
C2 =((IF(GCD(2,A2)>1,1,0)+IF(GCD(B2,2)>1,2,0)))
D2 =IF(C2=3,D1+1,D1)
E2 =IF(A1=B1,A1*(2^D1),"NOT YET")
Highlight row 2, pull down
Answer (GCD of Num1 and Num2) will be in the E column

Is This A Good Question/Topic? 0

Page 1 of 1

 .related ul{list-style-type:circle;font-size:12px;font-weight:bold;}.related li{margin-bottom:5px;background-position:left 7px!important;margin-left:-35px;}.related h2{font-size:18px;font-weight:bold;}.related a{color:blue;}