Need a Macro for division

talisman77

New Member
Joined
Apr 7, 2011
Messages
26
I have a column of 480 numbers that needs to be divided by the column to the right of it also containing 480 numbers.

I don't know how to write a macro so any help would be greatly appreciated!

Thanks,
Bob
 
Comfy....I did that and this is what showed up in each cell.....#DIV/0!<table style="width: 75px; height: 23px;" border="0" cellpadding="0" cellspacing="0"><col width="75"><tr height="21"> <td class="xl64" style="height: 15.75pt; width: 56pt;" width="75" height="21">
</td> </tr></table>
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Comfy....I did that and this is what showed up in each cell.....#DIV/0!<table style="width: 75px; height: 23px;" border="0" cellpadding="0" cellspacing="0"><col width="75"><tr height="21"> <td class="xl64" style="height: 15.75pt; width: 56pt;" width="75" height="21">
</td> </tr></table>

One of you cells either A or B contains a Zero

You cannot divide a number by Zero.

You can use an if statement to show these as blanks?
 
Upvote 0
Comfy...I am getting really close! My first column starts at IL4 and goes to IL408. The second column starts at IM4 and goes through IM408...

The formula works fine when I put it in one cell but how do I make it work for all those cells in column IN where I need the answers. I tried IL4-408/IM4-408 but that didn't work....
 
Upvote 0
Comfy...I am getting really close! My first column starts at IL4 and goes to IL408. The second column starts at IM4 and goes through IM408...

The formula works fine when I put it in one cell but how do I make it work for all those cells in column IN where I need the answers. I tried IL4-408/IM4-408 but that didn't work....

In IN4 type:
Code:
=IL4/IM4

Hover you mouse pointer over the bottom right corner of cell IN4
your mouse pointer will change, double click the left mouse button to copy down.

Alternatively single click and hold the bottom right corner and drag your mouse downwards.
 
Upvote 0
I did that and it gave the answer to row 4 all the way down in every cell.....I think I need to put in something like =IL4-408/IM4-408 or something like that but when I tried that it didn't work either.
 
Upvote 0
That wouldn't work.

When entering the formula make sure the cell references are not absolute.

it needs to be:

=IL4/IM4

not

=$IL$4/$IM$4
 
Upvote 0
My formula is exactly =IL4/IM4....
It only calculates for row 4 and then copies that answer all the way down to row 408.
 
Upvote 0
For IN4, 5 and 6 do your formulas look like this:

<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>IL</th><th>IM</th><th>IN</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">10</td><td style="text-align: right;;">1</td><td style="text-align: right;;">10</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;">20</td><td style="text-align: right;;">2</td><td style="text-align: right;;">10</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: right;;">35</td><td style="text-align: right;;">5</td><td style="text-align: right;;">7</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">IN4</th><td style="text-align:left">=IL4/IM4</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">IN5</th><td style="text-align:left">=IL5/IM5</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">IN6</th><td style="text-align:left">=IL6/IM6</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0
No...When I copy the formulas all the way down it just gives me the answer to row 4 and then copies that answer all the way down. I have Excel 2010 if that makes a difference....

Excel 2010<table style="background-color: rgb(255, 255, 255); border: 1px solid rgb(166, 170, 182); border-collapse: collapse; width: 105px; height: 106px;" cellpadding="2.5px" rules="all"><colgroup><col style="background-color: rgb(224, 224, 240);" width="25px"><col><col><col></colgroup><thead><tr style="background-color: rgb(224, 224, 240); text-align: center; color: rgb(22, 17, 32);"><th>
</th><th>IL</th><th>IM</th><th>IN</th></tr></thead><tbody><tr><td style="color: rgb(22, 17, 32); text-align: center;">4</td><td style="text-align: right;">43</td><td style="text-align: right;">1</td><td style="text-align: right;">43</td></tr><tr><td style="color: rgb(22, 17, 32); text-align: center;">5</td><td style="text-align: right;">20</td><td style="text-align: right;">2</td><td style="text-align: right;">43</td></tr><tr><td style="color: rgb(22, 17, 32); text-align: center;">6</td><td style="text-align: right;">35</td><td style="text-align: right;">5</td><td style="text-align: right;">43</td></tr></tbody></table>
Sheet1


I do not have these formulas when I copy...it only copies =IL4/IM4 in every cell all the down to row 408 but I don't actually see these formulas....I just see the answer from row 4 in every cell down to row 408
Worksheet Formulas<table style="border: 1px solid rgb(166, 170, 182); text-align: center; background-color: rgb(255, 255, 255); border-collapse: collapse;" cellpadding="2.5px" width="100%" rules="all"><thead><tr style="background-color: rgb(224, 224, 240); color: rgb(22, 17, 32);"><th width="10px">Cell</th><th style="text-align: left; padding-left: 5px;">Formula</th></tr></thead><tbody><tr><th style="background-color: rgb(224, 224, 240); color: rgb(22, 17, 32);" width="10px">IN4</th><td style="text-align: left;">=IL4/IM4</td></tr><tr><th style="background-color: rgb(224, 224, 240); color: rgb(22, 17, 32);" width="10px">IN5</th><td style="text-align: left;">=IL5/IM5</td></tr><tr><th style="background-color: rgb(224, 224, 240); color: rgb(22, 17, 32);" width="10px">IN6</th><td style="text-align: left;">=IL6/IM6</td></tr></tbody></table>
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,239
Members
452,898
Latest member
Capolavoro009

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