Compare Data from Two Columns and Match Figures Against Each Other - excel

I'm trying to compare figures from Sales data where Data set 1 (column A) comes in before the data set 2 (column B). Generally this data lines up chronologically, but it does not always and never row by row when pasted side by side. This is because column A is just transaction totals and column B contains the transactions split into product totals. For example:
Bob buys a $2 widget, $3 ball and a $5 stick. The data entry as it appears to me would be Column A $10 and Column B $2, $3 & $5.
These transactions don't occur often however and I need to isolate them from the overall data set and any figures that don't have matches. Most of the data generally has one to one transactions. For example:
Fred buys $5 widget. Column A $5 Column B $5.
Highlighting the matching 1 for 1 figures cells and leaving the odds fill blank would be optimal.
I have tried a few formulas and am getting nearly 90% success rate, which is close, but so frustrating. Basically just need a formula that will format the cells that have a 1 for 1 unique match in both columns and leave the ones that don't have a buddy highlighted. Also has to be done chronologically (so something in say column A row 112 can't match column b row 56).
So if anyone can help me out that'd be amazing. My only other option is analysing 10,000+ lines manually. Save me internet!
ps - sorry for the formatting, couldn't post lined up because it thinks I'm coding.

For Column E
=INDEX($B$2:$B$100,MATCH($E2,$B$2:$B$100,0))
A B C D E
2 Date WData Date DB Data
3 2/10/2018 1000 2/10/2018 1000 1000
4 2/10/2018 800 2/10/2018 450 #N/A
5 2/10/2018 900 2/10/2018 350 #N/A
6 2/10/2018 850 2/10/2018 900 900
7 2/10/2018 680 2/10/2018 850 850
8 2/10/2018 790 2/10/2018 680 680
9 2/10/2018 645 2/10/2018 790 790

Related

How to join 1.5 million rows of data based on 15 fields

I have a fact table of sales data from the year 2019, which has about 1.5 million rows of data. I need to compare 2019 sales with 2018 sales. The 2018 sales fact table also has about 1.5 million rows of data.
Each fact table has 15 of the same columns which include fields such as date, category, department, location, etc.
Date
Field 1
Field 2..
…field 15
Sales
01.01.18
ABC
XYZ
A12
100
01.02.18
ABCD
XXY
A13
200
01.03.18
ABB
XYY
A14
300
01.04.18
ACC
ZXX
A15
400
Date
Field 1
Field 2..
…field 15
Sales
01.01.19
ABC
XYZ
A12
110
01.02.19
ABCD
XXY
A13
210
01.03.19
ABB
XYY
A14
310
01.04.19
ACC
ZXX
A15
410
I need to have 2018 sales and 2019 sales in two columns that are next to each other.
I have tried this through a left join (matching the minimum amount of fields needed for a correct mapping) , but then my PC ran out of memory. I also tried doing this through power pivot, but my PC also ran out of energy while attempting to load the second fact table to the data model.
How can I have 2018 Sales and 2019 Sales, with the correct mapping, in columns next to each other?
Date '18
Date '19
Field 1
Field 2..
…field 15
Sales 2018
Sales 2019
01.01.18
01.01.19
ABC
XYZ
A12
100
110
01.02.18
01.02.19
ABCD
XXY
A13
200
210
01.03.18
01.03.19
ABB
XYY
A14
300
310
01.04.18
01.04.19
ACC
ZXX
A15
400
410
Assuming the csv data is imported to Sheet2(2018) & Sheet3(2019) via Data > Get External > From text. Put this in Sheet A1 :
=OFFSET(INDIRECT(CHOOSE(2-MOD(COLUMN(),2),"Sheet2","Sheet3")&"!A1",TRUE),ROW()-1,INT(COLUMN()/2+0.5)-1)
and drag right+downwards.
Idea : use column() with mod(), to 'drive' offset cell selection. choose() do the sheet selection.
Please share if it works/not. ( :

Concatenating INDEX/MATCH with multiple criteria and multiple matches

I am using Excel to track a team game where players are divided into teams and subteams within teams. Each player within a subteam scores a certain number of points, and I would like to have a summary string for each player with the number of points other players in the same subteam scored.
Example:
A B C D
PLAYER TEAM SUBTEAM POINTS
Alice Red 1 70
Bob Red 1 20
Charlie Red 1 10
Dave Red 2 70
Erin Red 2 30
Frank Blue 1 55
Grace Blue 1 45
My desired output looks like this:
A B C D E
PLAYER TEAM SUBTEAM POINTS SUMMARY
Alice Red 1 70 Bob:20, Charlie:10
Bob Red 1 20 Alice:70, Charlie:10
Charlie Red 1 10 Alice:70, Bob:20
Dave Red 2 70 Erin:30
Erin Red 2 30 Dave:70
Frank Blue 1 55 Grace:45
Grace Blue 1 45 Frank:55
The furthest I was able to go is a combination of CONCATENATE, INDEX, and MATCH in an array formula:
{=CONCATENATE(INDEX($A$2:$A$8,MATCH(1,(C2=$C$2:$C$8)*(B2=$B$2:$B$8),0)), ":", INDEX($D$2:$D$8,MATCH(1,(C2=$C$2:$C$8)*(B2=$B$2:$B$8),0)))}
This unfortunately just outputs a summary for the first player in the subteam:
A B C D E
PLAYER TEAM SUBTEAM POINTS SUMMARY
Alice Red 1 70 Alice:70
Bob Red 1 20 Alice:70
Charlie Red 1 10 Alice:70
Dave Red 2 70 Dave:70
Erin Red 2 30 Dave:70
Frank Blue 1 55 Grace:45
Grace Blue 1 45 Grace:45
What I need to do now is:
Excluding the player for the summary (I don't want Alice in the summary for Alice, but only Bob and Charlie)
Getting it to work for multiple matches (there can be an arbitrary number of players in each subteam)
Getting CONCATENATE to work with an unknown number of strings (because as said above, there can be an arbitrary number of players in each subteam).
Ideas appreciated!
I put together a helper column that concatenates each player/points and the TEXTJOINIFS from TEXTJOIN for xl2010/xl2013 with criteria for the desired results.
Unfortunately Excel (prior to Excel 2016) cannot conveniently join text. The best you can do (if you want to avoid VBA) is to use some helper cells and split this "Summary" into separate cells.
See example below. The array formula in cell E4 is dragged to cell J10.
= IFERROR(INDEX($A$4:$D$10,MATCH(SMALL(IF(($B$4:$B$10=$B4)*($C$4:$C$10=$C4)*($A$4:$A$10<>$A4),
ROW($A$4:$A$10)),E$3),ROW($A$4:$A$10),0),MATCH(E$2,$A$1:$D$1,0)),"")
Note this is an array formula, so you must press Ctrl+Shift+Enter instead of just Enter after typing this formula.
Of course, in this example I assume 3 players. Your requirement of arbitrary amount of players cannot be met with formulas alone, but you can just extend the "Summary" section over to the right as far as necessary.
If you really wanted to, you could even concatenate the "Summary" rows to form a single cell, e.g. something like:
= CONCATENATE(E4,": ",F4,", ",...)

Excel with rows of details related to other row

There is a way to have a group of rows related to other one, in the same sheet, like a more detailed information? Obviously must keep them always next to the main row if you filter or sort.
Desired example based on vehicles and travels:
A B C D
1 [ID] [VEHICLE TYPE] [BRAND] [COLOUR]
+ 2 A-171 PICKUP HONDA BLACK
- 3 [TRAVEL] [KM] [STATION]
- 4 12/08/2016 13.000 BARCELONA
- 5 13/08/2016 13.750 DONOSTI
+ 6 B-501 VAN RENAULT WHITE
- 7 [TRAVEL] [KM] [STATION]
- 8 12/08/2016 117.800 PARIS
- 9 13/08/2016 120.000 AMSTERDAM
- 10 14/08/2016 124.320 MUNICH
So when you sort the spreadsheet, should keep always the travel rows next to the vehicle row.
It is that possible? If not, what can I do to get this or similar? (I don't mind to use other sheet tab, but it wasn't the ideal)
You can use the Group function (Alt-A-G-G), and they won't be sorted as usual if you use sort on the whole column

Excel macro store value of vlookup and then add them up

So I have the following sheet setup:
Sheet 1
A B C
Tomatoes 100 50
Onions 20 0
Garlic 10 0
Chicken 0 100
Cheese 0 20
Where each column after A is a recipe and going down is the amount of grams required in the recipe of the ingredient.
Sheet 2 has cost per 100 grams per ingredient like so:
A B
Chicken 10
Tomatoes 1.5
Onions 2.25
What I'd like to do, is at the bottom of sheet 1 (ideally) under each column I could have the cost for the recipe.
In my mind it's broken down into 2 steps. Step 1 is do a vlookup from Sheet 1 to replace the grams to cost. Then do a sum of the entire column. I just don't know how to do that either in a macro or formula.
Refer the below specified link,
https://www.ablebits.com/office-addins-blog/2014/08/05/excel-vlookup-sum-sumif/#lookup-sum
You can download their worksheet here

multiple conditions in =sum

Phone number Provider Duration (min)
1001 Fastcom 2
1002 Fastcom 1
1004 Mobilecom 4
1008 Telecom 5
1001 Fastcom 3
1001 Fastcom 2
1003 Telecom 3
1004 Mobilecom 2
1008 Telecom 6
1002 Fastcom 1
I want to use one formula to get the sum of the duration of calls whose service provider is the provider for the phone number 1001. I hope this revised version is clearer than the previous one. Again, thanks to all who paid attention.
There are 14 rows. Column A contains numbers from 1 to 14. Column B contains Names of people(maybe repeated). Column C contains their preferred seasons (possible more than 1) and Column D contains how many days they do sports in that partucular season. I need one formula to get how many days are spent doing sports in the season(s) that is (are) preferred by Adam, which actually are Spring and Fall
Assuming data in rows 2 to 15 try this array formula
=SUM(IF(ISNUMBER(MATCH(C2:C15,IF(B2:B15="Adam",C2:C15),0)),D2:D15))
confirmed with CTRL+SHIFT+ENTER
In one formula I'm not sure. Personally I'd have a formula in each row of column E that is 0 or the value from D, then you can sum(e:e) instead.

Resources