Can't sum cells that reference cells of another worksheet - excel-formula

On my first worksheet I have a column of cells that reference cells in a second worksheet. They correctly display as numbers on worksheet 1. However, when I try to sum this column, I get a result of 0. I think I need to convert the display results to actual numerical values in worksheet 1. Does anyone know how to solve this?

Some steps to try with questions mixed in.
1) Update your question.
2) Check the format of the cells on Worksheet 2. What is it? General, Text, something else? Also, are all the cells with values on Worksheet 2 the same format?
3) What is the formula in the column of cells on Worksheet 1, which references Worksheet 2? I presume it looks something like this =Sheet2!A1. How did you copy the formula to the other cells in the column?
4) Is the list of values that you're attempting to Sum fairly short, like ten values or less? If so, post them.
5) Try selecting the column in Worksheet 1 and looking at the results of Functions Excel offers on the Status Bar (Average, Count, Numerical Count, Min, Max, Sum)--assuming your version of Excel has this.

You can simply solve this issue by add 0 at the end of those cells that you get linked from other sheets. like =(Sheet2!A1)+0. This will make the cell a numeric format. Now you can add these cell data easily.

Related

Fill data in excel sheet from master list from another sheet

I have data in two separate excel sheet in single file.
In the first sheet, I have two columns...like this
Sheet1
In the second sheet, I have one of the column which is same as Name in Sheet1. However, it does not have second column where I want to bring the value referring to the sheet 1.
Here is the second sheet.
Here in second column, i.e. Color I want to bring the value from first sheet.
I am using Libreoffice but can use excel as well. Pls suggest how I would do this in excel / libreoffice.
Solution for Excel...
So use sheet one as the reference sheet. Sheet two as the one you want to fill.
In B2 on Sheet 2 enter this formula:
=vlookup(A2,Sheet1!$A$1:B$6$,2,FAlSE)
Then drag down.
This is assuming that your reference in sheet one is in columns A and B and goes from rows 1 to 6.
Hope this helps.
One of the easier ways to do this would be to use VLOOKUP. So this requires 4 inputs:
The value you are searching for
The array you are searching in
The column where the value you want to return is in
"FALSE" to list if you want an exact match between the value you are searching for and the array you are searching in.
So in your example, we will use the worksheet where you only have the Names listed as the worksheet you are putting the formula, so something like this in B2:
=VLOOKUP(A2,sheet2!$A$2:$B$6,2,FALSE)
So this would lookup the value you show in worksheet 1 cell A2.
Then go to workbook 2 and match that value with what is in A2:A6.
Then lookup what is in column 2 for your answer.
And return what is in column 2 only if worksheet 1 cell A2 and something in worksheet 2 range A2:A6 is an exact match.
There are other ways, but for your example, this should be easiest in EXCEL. This only works if the value you are searching for is to the right of the value you are looking up. If you need to go to the left, INDEX/MATCH would be better (but not required here).
Hope this helps!
JW

excel link table range to value

I'm searching for a way to link the range of an Excel table to a specific number.
Let's say I have a table that has a range of A1:B10. I want to make the number '10' dynamic and link it to a number that is calculated from another sheet. Let's say cell F1 contains that number and the value is '20'.
Is it possible to make a dynamic range so the table range changes to: A1:B(F1). Then my table would adapt automatically and this has to work in my file.
I prefer a formula instead of a macro in VBA, because I normally don't work with VBA.
An alternative is to use a dynamic named range which is what we used to do before tables. The range, enclosed by marching ants below, is defined as follows:
=OFFSET(Sheet3!$A$1,0,0,Sheet3!$F$1,5)
The top left cell is A1. It is as many rows deep as the number in F1 and 5 columns wide (which could also be made dynamic).
Yes, INDIRECT is your way to make any formula dynamic / dependent on other cell values.
Say you want to sum range A2:C2. But the value 2 for C is located in Cell G2.
=SUM(INDIRECT("A2"&":C"&G2))
this is equal to write =SUM(A2:C2) in my example below.
If you set G2 to 3 it would calculate A2:C3 for this =SUM(INDIRECT("A2"&":C"&G2)).
If you mean Excel table, I guess the answer is no with formula, probably with VBA.

Multiply all columns in an excel worksheet by the values in the first column

I have an excel worksheet with 1153 columns. I need the values in each column to be multiplied by those in the first column. I have inserted blank columns between each column to add the results and right now I am doing this by hand, but it is taking too long. Here is an example:
Example
EDIT- Right now I am copying the formula $A1*adjacent cell into each blank column and then simply double clicking to population the rest of the column. My hope was that there was an alternative.
Is there VBA code, a macro, or a formula that would make this process faster? Thank you.
It sounds like your looking for some form of direct addressing. For example, the relative cell address "A1" will change if you copy the address to another cell, but the address"$A$1" will always reference cell A1 regardless of where you copy it to.
However you can fix only the row or column with the address "A$1" or "$A1" so that the address will always reference the same row or column, but will update the other as it's copied. In your case you probably want to fix the column with "$A1".

excel 2010, look up blank cells in two columns, return text in corresponding different column

Here is a screenshot of my data:
I want to search B4:B40 and C4:C40 and find all cells that are blank for both specified ranges. If blank in both ranges, return the text in the corresponding row in column A. Ideally, the output could be combined and it could list something like 8:00-2:00.
here is what i have so far:
=INDEX('C:\Path\to\other\worksheet\[Blank Schedule Grid.xlsx]Susan'!B4:B40, MATCH("",'C:\Path\to\other\worksheet\[Blank Schedule Grid.xlsx]Susan'!B4:B40,0),'C:\Path\to\other\worksheet\[Blank Schedule Grid.xlsx]Susan'!B2)
Am I on the right path?
The formula you want is:
=IFERROR(INDEX($A$18:$A$40,AGGREGATE(15,6,(ROW($A$18:$A$40)-ROW($A$18)+1)/(($B$18:$B$40="")*($C$18:$C$40="")),ROW(1:1))),"")
I will let you put in the workbook and sheet references. They are only needed on the Ranges. Do not put them on the Range references in the the ROW() functions. They are only there to return a number and it does not matter the sheet to which they reference. Just make sure that the ranges themselves match.
The concatenation with the workbook references would make the formula long and unwieldy. To do that VBA would be the best route.
Edit:
Got bored and decide to put in your workbook and worksheet references:
=IFERROR(INDEX('C:\Path\to\other\worksheet\[Blank Schedule Grid.xlsx]Susan'!$A$4:$A$40,AGGREGATE(15,6,(ROW($A$4:$A$40)-ROW($A$4)+1)/(('C:\Path\to\other\worksheet\[Blank Schedule Grid.xlsx]Susan'!$B$4:$B$40="")*('C:\Path\to\other\worksheet\[Blank Schedule Grid.xlsx]Susan'!$C$4:$C$40="")),ROW(1:1))),"")
Do you want all the values in a single cell or in a new column?
=IF(AND(ISBLANK(B18), ISBLANK(C18)), A18, "")
Assuming your data starts in A18 (as per the screenshot), you can put this in cell D18 and copy all the way down.

How to make a VLOOKUP formula conditional in Excel?

I've got a large Excel workbook with multiple worksheets and copious amounts of data. Every third sheet is an amalgam of the previous two sets. I've set up the following formula to pull the data from each worksheet, add it together, and present it in the third worksheet:
=SUM(VLOOKUP($A7,'worksheet 1'!$A:$F,2,FALSE)+VLOOKUP($A7,'worksheet 2'!$A:$F,2,FALSE))
This works as expected, unless the column A value is in one of the source worksheets but not the other. Then, I get the #N/A error with "Value not available."
What I want to do is make it so that, if the column A value is not present in the first worksheet, excel ignores that VLOOKUP request and simply pulls in the data from the second worksheet (and vice-versa for a value in the #2 but not #1).
If VLOOKUP isn't the appropriate tool to use, I can change it. I had an example sheet that I used to build this query, and that's how they put it together.
I am not an Excel expert and I've never used Access, so I'm learning as I go. Any assistance is appreciated!
Since you are using numbers, you could actually use multiple sumif statements.
I would suggest something like:
=SUM(SUMIF('worksheet 1'!$A:$A,$A7,'worksheet 1'!$B:$B), SUMIF('worksheet 2'!$A:$A,$A7,'worksheet 2'!$B:$B))
SUMIF is faster, won't look in the entire range, and if it does not find the value in A7, it will simply return 0.
I hope this helps.
UPDATE
Simple example. Say we have 2 sheets with a total column and we would like to get the value of that total cell:
you could sum 2 VLOOKUP forumale, or you could use SUMIF as follows:
=SUM(SUMIF(Sheet1!$A:$A,$A$7,Sheet1!$B:$B),SUMIF(Sheet2!$A:$A,$A$7,Sheet2!$B:$B))
The above is simply saying: Look for the value in cell A7 in the range $A:$A in sheet1 and return what's in the same row in the range $B:$B, and do the same in sheet2, then sum them both.
Note that SUMIF will actually sum all the resutls in a range, so if you have 2 totals in Sheet1!$A:$A then it will sum them both up. In a way this is the opposite of what VLOOKUP will do: it will stop once the first row containing the value is found. SUMIF won't stop.
The desired result in the example above is 208 and that's what you shall get.

Resources