Combining two columns and retuning the result in a third

gberg

Board Regular
Joined
Jul 16, 2014
Messages
180
Office Version
  1. 365
Platform
  1. Windows
I have two tables (they will have the same number of rows) on two different worksheets.
Table 1 on Sheet 1 has columns for Feet and Inches
Table 2 on Sheet 2 has a column for Length

Is there a way to:
  • Divide the Inches column by 12 to get it into feet, then combine it with the feet column
  • Paste the result into the Table 2 "Length" column on Sheet 2


Example:
Table 1 (on Sheet 1)
FEETINCHES
106
53
80


The end result would be
Table 2 (on Sheet 2)
LENGTH
10.5
5.25
8

Thanks

Greg
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Is this what you mean?

gberg.xlsm
AB
1FEETINCHES
2106
353
480
Sheet1


gberg.xlsm
A
1Length
210.5
35.25
48
Sheet2
Cell Formulas
RangeFormula
A2:A4A2=Sheet1!A2:A4+Sheet1!B2:B4/12
Dynamic array formulas.
 
Upvote 0
I just tried your formula and it works!

=Table1[@Feet]+(Table1[@Inches]/12)

I then just copy the formula down, all good!

Thanks for your help
 
Upvote 0
Sorry, I wanted to do this in a VBA code
Like this then?

VBA Code:
Sub ConvertLength()
  Dim lr As Long
  
  lr = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
  With Sheets("Sheet2").Range("A2")
    .Formula2 = Replace("=Sheet1!A2:A#+Sheet1!B2:B#/12", "#", lr)
    .SpillingToRange.Value = .SpillingToRange.Value
  End With
End Sub
 
Upvote 0
Solution
=Table1[@Feet]+(Table1[@Inches]/12)

I then just copy the formula down, all good!
If they are both already formal tables with the same number of rows then you should not need to copy the formula down, it should automatically spill down
 
Upvote 0
Peter, thanks for the help I got your solution to work!
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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