How to get data from other sheet using date - excel

i have
sheet1,
Name Date Amount
Ali 1-Sep 50
Ali 2-Sep 100
Ali 5-Sep 30
13-Sep 40
9-Aug 50
25-Sep 60
and sheet2,
Name Date Amount
Ali 1-Sep 100
Ali 2-Sep 100
Ali 5-Sep 85
Ali 13-Sep 34
Ali 9-Aug 88
Ali 25-Sep 25
on sheet 3, how do i search both sheet1 and sheet2 using dates, get the amount from both sheets and sum both amount on sheet3
output :
Nama Tarikh Total
Ali 1-Sep 150
Ali 2-Sep 200
3-Sep
4-Sep
5-Sep 115
6-Sep
7-Sep
8-Sep
9-Sep 138
10-Sep
11-Sep
12-Sep
13-Sep 74
thank you in advance

You can use the VLOOKUP function to get the total. Enter the following formula into cell C2 in Sheet3:
=IFERROR(VLOOKUP(B2, Sheet1!$B$2:$C$7, 2, 0) + VLOOKUP(B2, Sheet2!$B$2:$C$7, 2, 0), 0)
This assumes that your data in sheets 1 and 2 are structured as follows:
A B C
1 Name | Date | Amount
2 Ali | 1-Sep | 50
3 Ali | 2-Sep | 100
4 Ali | 5-Sep | 30
5 | 13-Sep | 40
6 | 9-Aug | 50
7 | 25-Sep | 60

You can use =Sheet1!A1 and =Sheet2!A1 on Sheet3.
In general: use "=[SheetName]![CellName].
To see this easier: type '=' in the required ceel in sheet3 and click another sheet to chose the required cell. Excel will do the job for you

Related

Excel RANGE VLOOKUP

STUDENT TIME SCORE WANT
JOHN 1 68 146
JOHN 2 78 146
JOHN 3 77 146
JOHN 4 91 146
JOHN 5 96 146
JAMES 1 66 119
JAMES 2 53 119
JAMES 3 80 119
JAMES 4 96 119
JAMES 5 50 119
JAMES 6 94 119
I have data COLUMNS 'STUDENT' AND 'TIME' AND 'SCORE' and wish to create 'WANT' and the rule which for I will need VLOOKUP is this: WANT = the sum of the SCORE values at TIMES 1 and 2, so I WISH TO USE VLOOKUP to find the 'SCORE' values for each 'STUDENT' at TIMES 1 and 2 and take the sum.
You can try SUMIFS() in this way.
=SUM(SUMIFS($C$2:$C$12,$B$2:$B$12,{1,2},$A$2:$A$12,A2))
It may need to array entry for older versions of excel. Array entry by CTRL+SHIFT+ENTER.
Assuming your dataset is ordered by "student name" (with unique student names), then "time", you could use :
Classical way, in F2 :
=IF(AND(B2=1,B3=2,A2=A3),C2+C3,IF(AND(B2=2,B1=1,A2=A1),C2+C1,OFFSET($F$1,MATCH(A2,A$2:A2,0),0)))
Greedy way (Office365 needed), in E2 :
=SUM(FILTER($A$2:$C$12;($B$2:$B$12<=2)*($A$2:$A$12=A2)))-3
Reference :

Sum of numbers by bill numbers in excel?

sno sales
1 25
2 12
11
10
3 989
345
122
I need formula to do addition on sno wise.
Out anwser should be
25
33
1456
Add a helper column with the following formula:
=IF(A2<>"",A2,C1)
Then from the two left columns create a Pivot Table:

Excel: Average values where column values match

What I am attempting to accomplish is this - where Report ID matches, i need to calculate the average of Value, and then fill the rows with matching Report ID's with the average for that array of Value.
The data essentially looks like this:
Report ID | Report Instance | Value
11111 1 20
11112 1 50
11113 1 40
11113 2 30
11113 3 20
11114 1 40
11115 1 20
11116 1 30
11116 2 40
11117 1 20
The end goal should look like this:
Report ID | Report Instance | Value | Average
11111 1 20 20
11112 1 50 50
11113 1 40 30
11113 2 20 30
11113 3 30 30
11114 1 40 40
11115 1 20 20
11116 1 30 35
11116 2 40 35
11117 1 20 20
I have tried using average(if()), index(match()), vlookup(match()) and similar combinations of functions, but I haven't had much luck in getting my final output. I'm relatively new to using arrays in excel, and I dont have a strong grasp on how they're evaluated just yet, so any help is much appreciated.
Keep it simple :-)
Why not using =sumif(...)/countif(...) ?

Returning next match to a equal value in a column

I often need to search through columns to find the match to values and then return the according value.
My issue is that INDEXand MATCHalways return the first value in the column.
EX. I got 7 car dealers and this is the sales last month. Oslo and Berlin sold the same ammount and INDEX(D:E,MATCH(B1,E:E,0),1)) in column C will return the first hit from column D.
A B C D E
rank Sales Delaer
1 409 London | Tokyo 272
2 272 Tokyo | London 409
3 257 Hawaii | oslo 248
4 255 Stockholm | numbai 240
5 248 Oslo | Berlin 248
6 248 Oslo | hawaii 257
7 240 Numbai | Stockholm 255
At the moment my best solution is to first find the row each value in B got in E with MATCH(B1,E:E,0) and add that to a new column (column F). Then I can add another formula in the next column, which is what I currently have to do:
=IF(F2=F1;MATCH(F2;INDIRECT("F"&(1+F1)):$F$7;0))+F2
Is there a better approach at this?
In B2 use the following standard formula,
=IFERROR(LARGE(E$2:E$8, ROW(1:1)), "")
Fill down as necessary.
In C2 use the following standard formula,
=INDEX(D$2:D$8, AGGREGATE(15, 6, ROW($1:$7)/(E$2:E$8=B2), COUNTIF(B$2:B2, B2)))
Fill down as necessary.
        
[Optional] - Repair the ranking in column A.
In A2 use the following formula,
=SUMPRODUCT((B$2:B$8>=B2)/(COUNTIFS(B$2:B$8, B$2:B$8&"")))
Fill down as necessary.
        

Excel - Sorting based on metric values

I have a dataset which looks like:
Product Metrics C1 C2 C3
A1 Q1 20 30 10
Q2 213123 2312 32123
Q3 454 65 45
Q4 3 4 6
A2 Q1 10 5 1
Q2 123 13 23
Q3 454 65 45
Q4 3 4 6
A3 Q1 18 6 3
Q2 123 13 23
Q3 454 65 45
Q4 3 4 6
Now I want to sort the values based on metric Q1 - From smallest to largest (comparing against the product -A1,A2) then the final dataset should look like,
Product Metrics C1 C2 C3
A2 Q1 10 5 1
Q2 123 13 23
Q3 454 65 45
Q4 3 4 6
A3 Q1 18 6 3
Q2 123 13 23
Q3 454 65 45
Q4 3 4 6
A1 Q1 20 30 10
Q2 213123 2312 32123
Q3 454 65 45
Q4 3 4 6
hope this gives a clear picture. Thanks in advance guys
The way I would probably do it is transpose your columns and rows so that you have columns for Q1, Q2, Q3, Q4.
Like this:
Product Metrics Q1 Q2 Q3 Q4
A1 C1 20 213123 454 3
A1 C2 30 2312 65 4
A1 C3 10 32123 45 6
A2 C1 10 123 454 3
A2 C2 5 13 65 45
A2 C3 1 23 45 6
Then you can sort by Q1 using Data>Sort & Filter
CBRF23 already pointed in the right direction but I believe you have to go even a little bit further and flatten each product related sub-array into a single row like
A | B C D | E F G | H I J | K L M
---| Q1 --------| Q2 ------------ | Q3 ------- | Q4 -------
Pr | C1 C2 C3 | C1 C2 C3 | C1 C2 C3 | C1 C2 C3
A1 | 20 30 10 | 213123 2312 32123 | 454 65 45 | 3 4 6
A2 | 10 5 1 | 123 13 23 | 454 65 45 | 3 4 6
A3 | 18 6 3 | 123 13 23 | 454 65 45 | 3 4 6
(The first row just shows the Excel columns, second row the flattened Q1,Q2,Q3 and Q4 sections and third row the sub-headers for each column)
Now you can safely sort by column B. In case you want to sort by the sum of all Q1 metrics you could introduce another column N being the sum of B,C and D and use that for sorting.
Update:
To get your desired output format back there are basically to possibilities:
If the number of records is known and fixed you can set-up a "results" page in your excel folder with a list of small "sub-tables". The fields of each sub-array then directly reference the "transposed" fields in a line of the sorted master results array.
If the number of results is variable you will have to construct/reconstruct the results page mentioned above using a suitable vba script. The vba generated page can of course also consist of the sorted values directly rather than referencing the values in the sorted master array.

Resources