Nov 18 2021 01:53 AM
Dear All,
First off; thank you for taking the time to help me.
I've been looking for the right fix for my problem but can't wrap my head around it.
Solution: formula which categorizes companies, in category A, B or both, based on money spent.
Situation:
I've got three excel files. Excel file 1 contains companies of which i want to know whether they belong to Category A, Category B or both. The only way for me to know whether the company named in excel 1 belongs to one of the categories is to look up the name or number in Excel 2 & 3 and check whether money was spent on them. If excel 2 states a positive amount then the company belongs to category A, if excel 3 states a positive amount then the company belongs to category B. However, if excel 2 & 3 state a positive amount then the company belongs to category A & B.
(please read excel files containing data)
Already tried:
Vlookup
1. Look up the company name of excel 1 in excel 2
2. If found name the amount spent
IF function
1. If the amount is >=0.01
2. If true then return "category A"
3. If False then return "no spend or Negative"
I have done the same for category B but repalced excel 2 for excel 3.
Problems encountered:
I have encountered the following problems
Actions taken:
I have tried the following solutions.
Excel Files and the containing data
Excel 1 contains
Excel 2 contains
Excel 3 contains
Again thank you for helping me.
Nov 18 2021 03:28 AM
That's more job for Power Query. If with formulas when use SUMIFS(), not lookup functions.
Nov 18 2021 03:35 AM
Nov 18 2021 04:14 AM
Power Query is part of Excel, this functionality is under Get & Transform tab.
Again, you may use SUMIFS() formulas to return companies spending.
Nov 19 2021 11:47 AM
Power Query as well as Visual Basic macro language are both parts of an Excel installation but they demand knowledge very different from the spreadsheet.
Using SUMIFS to find the total amount spent for each company mentioned in table Excel_1 will calculate the sum no matter their order respective tables.
If the amount is greater than zero, the IF statement should result in a letter, A or B.
The two are then concatenated using &.
=IF(SUMIFS(Excel_2[4. Amount of money spent];Excel_2[3. Company number ];[@[Company number]])=0;"";"A")
&
IF(SUMIFS(Excel_3[4. Amount of money spent];Excel_3[3. Company number ];[@[Company number]])=0;"";"B")
Excel_1 columns E to I calculates this step by step while col J makes it all in one formula.
If you are not using 'pyamas' tables, change the column references to your columns, eg cell J3 using ranges in other files like
=IF(SUMIFS([Book2]Sheet1!$D:$D;[Book2]Sheet1!$C:$C;C3)=0;"";"A")
&
IF(SUMIFS([Book3]Sheet1!$D:$D;[Book3]Sheet1!$C:$C;C3)=0;"";"B")
Nov 23 2021 12:00 AM