Excel Data Solutions - excel

Here are my 2 columns:
| C | B |
| 378 | 124.14 |
| 378 | 0.47 |
| 378 | 125.00 |
| Total | 249.61 |
I would link Total data in another sheet but I could not find excel proper function.

It's a little hard to tell what your table looks like from what you've copied & pasted. Assuming it looks like this:
+---+-------+-------+
| | B | C |
+---+-------+-------+
| 1 | 378 | 124.14|
+---+-------+-------+
| 2 | 378 | 0.47|
+---+-------+-------+
| 3 | 378 | 125 |
+---+-------+-------+
+ 4 + TOTAL + 249.6 +
+---+-------+-------+
The address of your total is C4.
Call this worksheet Sheet1 and the file File1.xls.
To access cell C4 from another worksheet in the same file: =Sheet1!C4
To access cell C4 from another file: =[File1.xls]Sheet1!$C$4

This might be over-simplifying, but you can just click the target cell, type = then click on the source sheet and click on the total.

Related

Excel - How to countif within column B excluding duplicate values from column A?

The spreadsheet I am working with houses multiple duplicates for CLIENT_ID and I want to be able to count each CLIENT_ID only once, and then count the amount of a specified value within AGE_CATEGORY. Basically I want to exclude any duplicates and then countif.
| Column A | Column B |
+-----------+--------------+
| CLIENT_ID | AGE_CATEGORY |
| 1514 | 65 |
| 1517 | 65 |
| 1522 | 17 |
| 1519 | 37 |
| 1514 | 65 |
| 1516 | 28 |
| 1503 | 20 |
--- I would like for the count for people >=65 to be 2, since client# 1514 appears twice.
How can I do it?
What you need is first extract unique values from column A then count those IDs. As per my below screenshot use below formulas ExcelO365 formulas.
D2 =UNIQUE(A2:A8)
E2 =COUNTIF(A2:A8,D2#)
Create a list of unique age (category?) values — say, in Column D
— with “Data” → “Sort & Filter” → “Advanced (Filter)”. 
(Sort them if you want.) 
Enter
=SUM(--(FREQUENCY(IF(B$2:B$8=D2,A$2:A$8),A$2:A$8)>0))
into E2, press Ctrl+Shift+Enter,
and copy/drag down. 
This is the result:
| A | B | C | D | E |
---+-----------+--------------+--------------+--------------+-------+
1 | CLIENT_ID | AGE_CATEGORY | | AGE_CATEGORY | |
2 | 1514 | 65 | | 65 | 2 |
3 | 1517 | 65 | | 17 | 1 |
4 | 1522 | 17 | | 37 | 1 |
5 | 1519 | 37 | | 28 | 1 |
6 | 1514 | 65 | | 20 | 1 |
7 | 1516 | 28 | | | |
8 | 1503 | 20 | | | |
Based on this answer by SandPiper.
Assuming your data (to return values) is in A2:A8 and criteria is in B2:B8 use this ARRAY formula to check unique values >=65
=SUM(--(FREQUENCY(IF($B$2:$B$8>=65,MATCH($A$2:$A$8, $A$2:$A$8,0)),ROW($A$2:$A$8)-ROW($A$2)+1)>0))
Note for array formula you have to enter this formula with ctrl + shift + enter so that curly braces appear around the formula automatically.
Needless to say, you can change >=65 to your criteria accordingly. sample check see screenshot

VBA-Compare sheets and copy values from second sheet

I am trying to compare two workbooks and copy the 5th column to the 5th column first workbook if the first 3 columns match.
This check has to be done throughout the worksheet.
Worksheet 1:
| Heading 1 | Heading2 | Heading 3 | Total | Number1 |
|-----------|----------|-----------|-------|---------|
| ABC | EF | GH | | |
| XYZ | AB | EF | | |
| HIK | IJ | PQ | | |
Worksheet 2:
| Heading 1 | Heading2 | Heading 3 | Total | Number1 |
|-----------|----------|-----------|-------|---------|
| QRS | EF | GH | | 5 |
| XYZ | AB | EF | | 4 |
| DEF | QR | IV | | 16 |
| HIK | IJ | PQ | | 8 |
Desired output:
| Heading 1 | Heading2 | Heading 3 | Total | Number1 |
|-----------|----------|-----------|-------|---------|
| ABC | EF | GH | | |
| XYZ | AB | EF | | 4 |
| HIK | IJ | PQ | | 8 |
I tried to do the following, but it didn't work:
Dim i As Integer
Sheets("Sheet1").Activate
For i = 2 To 100
ActiveSheet.Cells(i,5).Select
ActiveCell.FormulaR1C1 = "=IFERROR(IF(AND(Table2[#[Heading1]]=Consolidated!RC[-4],Table2[#[Heading2]]=Consolidated!RC[-3],Table2[#[Heading3]]=Consolidated!RC[-2]),Table2[Number1],"" ""),"" "")"
Next i
I am a VBA novice and would be grateful for any help.
You can do this with formulas, no need for code. I'll assume that "Heading 1" is in cell A1 for this: Add a new column between heading 3 and Total. In the first cell add the formula =A2&B2&c2 and copy down. Do the same in the other workbook. Now in Number1 in the first book enter this formula
=IFERROR(OFFSET([OtherWorkbook]SheetName!D2,MATCH(D2,[OtherWorkbook]Sheetname!D2:D5),2),"")
(Using your workbook and sheet names. Now copy down. You can then hide the column we added at the start by setting its width to zero in both books.

Functional Error in Excel Array Formula

I have a table on which I want to perform to array operation. Here is my table
snapshot of Excel.
Table Data
+-------+---------+------+-------+
| Stock | Date | Open | Close |
+-------+---------+------+-------+
| GOOG | 10-1-12 | 759 | 762 |
| GOOG | 10-2-12 | 765 | 757 |
| GOOG | 10-3-12 | 756 | 763 |
| GOOG | 10-4-12 | 762 | 768 |
+-------+---------+------+-------+
My question now is why I am getting different values for the exact same formula in column E. I performed the similar process in column G but this time selecting G2:G5 and pressing Ctrl+Shift+Enter.
Formula in all cells in column E: =D2:D5-C2:C5

Count text occurrences in a column in Excel

I have the following list in Excel:
+-------+----------+
| am | ipiresia |
+-------+----------+
| 50470 | 29 |
| 50470 | 43 |
| 50433 | 29 |
| 6417 | 51 |
| 6417 | 52 |
| 6417 | 53 |
| 4960 | 25 |
| 4960 | 26 |
| 5567 | 89 |
| 6716 | 88 |
+-------+----------+
I want to add a column, let's say 'num' and count the occurrences of column 'am' in a row adding one when a new occurrence happens as follows:
+-------+----------+-----+
| am | ipiresia | num |
+-------+----------+-----+
| 50470 | 29 | 1 |
| 50470 | 43 | 2 |
| 50433 | 29 | 1 |
| 6417 | 51 | 1 |
| 6417 | 52 | 2 |
| 6417 | 53 | 3 |
| 4960 | 25 | 1 |
| 4960 | 26 | 2 |
| 5567 | 89 | 1 |
| 6716 | 88 | 1 |
+-------+----------+-----+
Is it possible to get this automatically with a formula in Excel?
yes,
my example:
(assume you start your table containing 3 columns at Excels origin at A1 without header lines)
Then fill C1 with value "1"
and then start in C2 with entering a formula
simple like this:
=if($A2=$A1;$C1+1;1)
then you drag C2 down at the cells downright located autofill position as far as you want. Most times also double click works to let Excel autofill the columns down to the end of you prefilled table.
If you need assistance for AutoFill press F1 in Excel an the help with tell you in detail.
Assuming the sample table starts at A1 (with headers) the following formula will provide the expected results even if the list is not sorted.
=COUNTIF($A$1:$A2,A2)
Enter the formula at cell C2 then paste it down to the last cell of the data (or use AutoFill)

Kind of group by in Excel without VBA

I need another transformation help in Excel
| A | B |
---| ----|--------|
1 | ID | Course |
2 | 1 | A1 |
3 | 1 | A2 |
4 | 2 | A1 |
5 | 3 | A2 |
I want to have a kind of group by, i.e.
| A | B | C |D | ...
---| ----|---------|---------|---------|----
1 | ID | Course1 | Course2 | Course3 | ...
2 | 1 | A1 | A2 | | ...
3 | 2 | A1 | | | ...
4 | 3 | A2 | | | ...
Any ideas? Is it possible without VBA macro?
I believe that the following link on removing duplicates from column would suit your needs (in your case you would do it horizontally).
http://www.get-digital-help.com/2009/03/30/how-to-extract-a-unique-list-and-the-duplicates-in-excel-from-one-column/
Per your reply to Robert, if you want to do it without VBA, try this... Select all cells in the first column. Copy and paste them into the first column of another worksheet. Use Excel's Remove Duplicates function on the pasted data. Then use INDEX functions in the columns to the right in order to pull the first, second, etc values matching that first column value.

Resources