Add The Number In Columns Together
Dec 22, 2008If I have a number in A1, and another number in B1, what formula should I use to add them together?
View 4 RepliesIf I have a number in A1, and another number in B1, what formula should I use to add them together?
View 4 RepliesI work on a daily basis with spreadsheets in excel. The number of columns is the same, but every single spreadsheet has a different number of rows. I recorded this macro in a table with 1196 rows and I would like to use this macro also in other tables with a different number of rows.
Sub City2()
'
' City2 Macro
'
'
Selection.Copy
Cells.Replace What:="POMPANO", Replacement:="Pompano Beach",
[Code].......
What If we had to replace any number..
Lets say, if we had to seperate NUMBER TEXT NUMBER in different combinations....
B2 contains values like these then
TOM CRUISE 12
TOM 5879 CRUISE
TOM CRUISE 123456789
123456789 TOM CRUISE
123 TOM CRUISE 456
[ = SUBSTITUTE(B2,"1234567890","") ]
I am at my wit's end pondering over it?
How to make the SUBSTITUTE function work for each individual digit?
I need to search multiple columns to find a match before I want the result selected which itself will be in a different column.
It seems to me to be an extension of the VLookup function. Attached is an example of the sort of spread sheet I am trying to pull data from. I am trying to get the result of Area 5G, for site ZZ, KPI 2.1, Date Apr-13. As well as the result for Area 5G, Site (empty), KPI 2.1, Date May-13. I hope this is not to convoluted
I have a number in column “A” and I want to match them with column “D“, the number in column “C” and “D” is true value. find attached sample sheet for more detail.
View 6 Replies View RelatedI have a column with all different numbers. I need to add 3 to each number. Ex. 12.46 needs to change to 15.46. This can be done in the same column or a different column. Doesn't matter. I just need to add 3 to each number in the column. Right now I'm typing them in :o
View 4 Replies View RelatedI want to select a number of columns. I know the column indexes.
I want to use something like (Doesn't work):
[Code] ......
Instead of (Works):
[Code] ....
Rows can be selected according to:
[Code] ....
I have written this code that works. But there must be an easier way:
[Code] ....
somehow i managed to do this at first and then forgot to save my personal work book and cant remember how to do it.
What it is, is if cell A1 has a certain phrase in it ie Customer Reference then i want to insert four columns before it so it ends up in cell E1.
The other thing which i never managed to do is. I have 5 workbooks. master, book 1-4. I want to past all info in columns A:T from Book 1-4 into Master in the next available row.
We have a sales table that 23 sales people update then send back to me. So each week I receive 23 worksheets.
The number of columns in the tables I get back can vary, depending on what each salesperson is reporting for that week.
I have written a macro that takes each sheet, automatically finds the last column and then adds two new columns of summary data.
I use COUNTA on the header row to find the number of colums. This usually works fine - but there is one problem that can occur.
Sometimes people insert one or more blank columns in the table. So how can I find the last column, because COUNTA won't work? (I do not want to simply delete these columns because some people have set up vlookups and their own macros based on the position of the columns they have defined, including the blanks.)
i am using the code
activesheet.usedrange.columns.count
to get to know the no of columns used in the data set in a worksheet. bt the problem is it is count the unnessary columns which are not part of the dataset too.
I want to have the number of used columns in a worksheet. The information will be used to understand what range the data is in. So for the rows I am using nRows = Application.WorksheetFunction.CountA(myRange). I am hoping to have something similar for the columns.
View 6 Replies View RelatedI want to be able to return the column number depending on the cell.
For example I have the months of the year horizontally from f6:Q6 and I need to be able to return what column number a certain month i depending on the month I type in cell A1.
I need a formula that will look at a row (say row 1) starting in column F. When the first positive value appears in the row, the formula will then sum that value and the next 11 columns in the same row. So for example, starting in row 1 column F - here is an example list of values
0 0 0 0 3 4 3 2 0 4 8 7 9 0 9 0 6 4 2 2 0 8 7
The total would be 49 (start summing at the first 3 (which would be column J)and finish with the 0 (which would be column U))
Lets assume the formula is in column AZ, row 1 and I then need to drag it down
an equivalent to the code
rows("8:10").select
for columns. I don't want to use the A, B notation but rather, column numbers.
I believe this rightmost column number information is available. I just could not find it!
View 3 Replies View RelatedHow can I count the number of used columns in a specific row? The below code doesn't work.
View 14 Replies View RelatedYou can always add numbers together. however, how can you vary columns based on a number?
for example, i can always do things like the following to change the number of rows selected in a column based on the variable numRows.
I want to loop through ID Column and find the matching number in Record No.column, and hightlight the entire row when match is found. The code I am running can only work for one cell at a time, but I want to run one time.
View 11 Replies View RelatedI am trying to combine 2 counting functions to count the number of rows that a certain value in 2 different columns. I think the 2 formulae I am trying to combine are:
=COUNTIF(N3:N136,-1)
=COUNTIF(X3:X136,1)
i.e. the number of rows that have both "-1" in column N and "1" in column X
(scroll down for example) I have 142 countries and 6 numbers beside each country starting from Column A, Cell 2 (A2) . I want to seperate the numbers into columns B,C,D,E,F,G
The formula I thought to usein B2 was =Right(A2,11) to give me the 3 next to Afghanistan in the ELICOS Column (B2) , but this gives me all the numbers
Question is How do I seperate each number so each one sits in the right column??
ELICOS
Schools
VET
Higher Education
Postgraduate Research
Non Award
AusAID/Defence
[Code]....
I am looking for a bit of code that will count the number of visible columns either. I have the following which is missing the code to establish if the range is visible or
Code:
Do Until rngVisibleColumnCount.Column = Range("HRISData_RoleError").Column
'Code to establish if visible
intVisibleColumnCount = intVisibleColumnCount + 1
Set rngVisibleColumnCount = rngVisibleColumnCount.Offset(0, 1)
Loop
I have a table of data (lets say A2:H30) i want to populate so i want the macro to loop based on how many columns i have? I am using this to post the data based on # of rows..
Sheets("Main Cal").Select Dim bottomA As Integer
bottomA = Range("D" & Rows.Count).End(xlUp).Row
Dim c As Range
Dim ws As Worksheet
For Each c In Range("D3:D" & bottomA)
Set ws = Nothing
On Error Resume Next
Set ws = Worksheets(c.Value)
On Error GoTo 0
If ws Is Nothing Then
I have a list of parts with quantities that i would like to distribute among several columns that represent cities, based on the number of parts in stock. For Example, if i have 5 parts and ten cities, i want it to put one part in the first five. In the case where theres more parts than cities i want it to loop back to the first city and add one and so on. I attached a sample spreadsheet.
View 5 Replies View RelatedLook at 2 columns and assess if certain criteria and then count the number of these certain criteria. I give an example below:
Column 1: Has a drop down box of possibilities from: "Red", "Amber", "Green", N/A
Column 2: Has a drop down box of possible choices of: "Significant", "Other".
What I would like to do is have a formula which will count the number of times you have "Red and Significant", "Red and Other", "Amber and Significant", "Amber and Other", "Green and Significant", "Green and Other" and "N/A and Significant" and "N/A and Other".
I am trying to average a range which continually changes depending on the amount of registries entered in a given week. for example, one week there may be 5 registries which would fill five columns while another week there may be 15 registries, once again filling 15 columns. I would like to find the average of x amount of columns.
My initial approach was to select the first blank cell to the right of the data and then find the last filled cell (which should be the first column of data.
with this range i tried hopelessly to use the average function (did not work):
Sub averagemake()
Dim iLastColumn As Integer
Dim Rng As Range
Sheets("All Data(Values)").Select
Range("A6").Select
Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
iLastColumn = Cells(6, Columns.Count).End(xlToLeft).Column
ActiveCell.FormulaR1C1 = "=AVERAGE(RC[-iLastColumn]:RC[-1])"
End Sub
Consider the following range (in my case a PivotTable):A1:E7
I create a Named Ranges that corresponds to column 1:3 and 6 from the range above. i.e : A1:C7,E1:E7
I need to find out the number of columns of my range, this is because it can change in the future, and I have an offset formula needing this information.
When i type =columns(MyNameRange) it returns #REF! as there are 2 areas in my Named Ranges. I am expecting 4.
I have written the a VBA User Defined Function that does the job, but I would like to know if there is no native solution to get this information.
Function TotColumns(rng As Range)
Dim Cols As Integer
For Each Ar In rng.Areas
Cols = Cols + Ar.Columns.Count
Next
TotColumns = Cols
End Function
In the attached excel file when I sum my columns, I would like that for columns which have "N/A", the sum should not be a number (Any positive number and zero).
So for example, In column E, the Sum in cell E6 should be anything but "0". Anything which is not a positive and "0" would be fine. Like having "-1" in E6 and F6 would be just fine.
I have an input box which asks the user to select a row that they wish to delete.
What I need to do is take the row number that has been selected and delete cells B:K and move the below cells up.
I am in need of a formula to calculate the even distribution of values between two set values over a set number of columns. For example take a look at the attached screenshot. I have the numbers 2.88 and 2.44 and I need to fill in the empty cells between the two with with an even distribution of numbers in between the two (in descending order) over the 8 columns Screen-shot-2014-02-16-at-3.33.08-PM.jpg
View 1 Replies View Relatedget this macro to paste the formula across to a variable number of columns? It is falling over at
VB:
Range(Cells(5, .Columns.Count)).Paste
VB:
Sub Clear()
'
With ActiveSheet
[Code]....