excel index/match with merged cell - excel-formula

Master Table
How should I set the formula to get the figures with multiple criteria in merged cell?
E.g. refer to the Master table, if I would like to know how many orders that Peter has made in Area 2 in Jan. I tried to use index match function, but didn't work out.
The criteria should go through > select "order" in column A > "Area 1" in column B > "Peter" in Column C > to have the row number, and match "2017/Jan" in column D.
Can anyone suggest a formula to me?

The same has been answered by A.S.H through comment, hence reflecting as unanswered.
Posting the answer behalf of A.S.H
Dealing with merged cells in formulas in a well-known tedious problem, especially when the formulas involve arrays, such as Index / Match/ SUMIF etc. If you can't Unmerge those cells, your best bet would be to use a hidden helper column.
My Suggestions:
Steps You Can Follow In These Scenarios
Create Name Manager by entering the cell ranges manually.
Formulas -> Name Manager -> New... -> Enter Group Name (Ex.Raw data) -> Select Where You Want To Apply the Scope -> Type Ranges as you required references (ex. =Sheet1!$A$1:$A$4)
When you typing the formula instead of array or match ranges you can directly use the Group Name that you have entered.
You can create helper column to fix the issue.
Type the cell ranges manually.
Use Concatenate Methods.

Related

How do I reference the three largest values in a column and their corresponding text in the column next to it?

I am building an excel sheet that returns the three highest values from a column in another sheet (sheet2, column B) along with their corresponding company (sheet2, column a). Ultimately, in sheet 1, I want to have a table that will display the company with those values.
This is what I am trying to achieve:
AWS ($280.9m), Google ($241.9m), Meta ($168.7m)
I was trying to use the large formula, but this does not help me with referencing the corresponding company so I’m unsure how to return both.
You can use LARGE to get your top-n, and then wrap with INDEX/MATCH and OFFSET to get the company name.
Cell E3 formula:
=LARGE($B$2:$B$7,ROW(E1))
Cell D3 formula, which returns the column to the left of the Large value:
=OFFSET(INDEX($B$2:$B$7,MATCH(LARGE($B$2:$B$7,ROW(D1)),$B$2:$B$7,0)),,-1)
or remove offset and use....
=INDEX($A$2:$A$7,MATCH(LARGE($B$2:$B$7,ROW(D1)),$B$2:$B$7,0))
Drag down your formulas as far as you would like.
The above solution is good but kinda oldschool. I would use =SORT() function instead:
=INDEX(SORT(A46:B56;2;-1);{1;2;3})
Translation to human language:
=INDEX(SORT(MyArray;ColumnToSortBy;Descending);{get first three rows}, [column])
*note: depending on your windows settings your Array row separator may differ. The easiest way to check your it is to select any range with more than one row, then get to formula bar and click F9 to see result preview.
where [column] is an optional argument, by default it takes 1st column.

SUMPRODUCT using filter as criteria

I want to add up the Balances (Column I) for the rows in which the Division (Column B) is "Service". This formula works:
=SUMPRODUCT(($B7:$B500="SERVICE")*I7:I500)
...which surprised me because I've never really understood SUMPRODUCT before.
Now instead of simply finding the "Service" rows, I want to use my filter to select "Service" or any other value of Column B. So now I need the formula to detect what the filter is set form.
I suspect there's a way to extract what's visible in Column B. Or maybe there's a way to do this using COUNTIF and/or SUBTOTAL.
From what I can understand, your current formula is working, however you need the flexibility to select the keyword in column B.
If that is correct, what I would suggest, is to create in a cell let's say "A1" a data validation list with the keyword you desire to have a SUMPRODUCT.
The formula would be modified as follow:
=SUMPRODUCT(($B7:$B500=$A$1)*I7:I500)

Insert Formula through Data Validation in excel

In Data validation list I defined formulas: ,=1,5+($B$1/$B$2),=2+($B$1/$B$2)*2,=2,7+($B$1/$B$2)*3 ..... and works well for me because I can see all formulas in dropdown list as they are to choose the appropriate one.
But I prefer to define them in a named range since number of formulas are around 20. Unfortunately I can see only the results instead of formula origins in dropdown list when I define as named range so makes me choose the suitable one impossible.
I wonder whether to see the formulas itself when I defined in named range. Thanks in advance.
It won't work. To see the formulas, you'd have to format them as text in the source cells, but then selecting them from the dropdown won't actually evaluate the formula.
Something like this may work.
A. Enter the list of the formulas you want to use in a range of your worksheet, one formula per cell, without the equals signs. An example list of formulas:
1
5+($B$1/$B$2)
2+($B$1/$B$2)*2
7+($B$1/$B$2)*3
B. Create the cell with Data Validation to select from the formula list
C. Use MATCH and CHOOSE to select which formula you want to use for calculations:
=CHOOSE(MATCH(Formula,FormulaList,0),1,5+($B$1/$B$2),2+($B$1/$B$2)*2,7+($B$1/$B$2)*3)
Here Formula and `FormulaList are placeholders (or named ranges) for the cell that has the chosen formula and the list of formulas, respectively.
Hope that helps

I want to compare two lists in different worksheets in Excel to locate any duplicates

I know this is very simple but I still need help:
I have a list of properties that have finished a training. I need the names of the ones that have not done this training, but the system does not give me such a list. However, I have a list of all our properties. That means I have to compare two columns in different worksheets.
The properties are identified by ID Numbers. What would make my life easier is that if there is a formula that can detect duplicates and highlight on the complete list of hotels so the ones that are not highlighted have not done the training.
Let me know if you have any recommendations for me!
Without VBA...
If you can use a helper column, you can use the MATCH function to test if a value in one column exists in another column (or in another column on another worksheet). It will return an Error if there is no match
To simply identify duplicates, use a helper column
Assume data in Sheet1, Column A, and another list in Sheet2, Column A. In your helper column, row 1, place the following formula:
=If(IsError(Match(A1, 'Sheet2'!A:A,False)),"","Duplicate")
Drag/copy this forumla down, and it should identify the duplicates.
To highlight cells, use conditional formatting:
With some tinkering, you can use this MATCH function in a Conditional Formatting rule which would highlight duplicate values. I would probably do this instead of using a helper column, although the helper column is a great way to "see" results before you make the conditional formatting rule.
Something like:
=NOT(ISERROR(MATCH(A1, 'Sheet2'!A:A,FALSE)))
For Excel 2007 and prior, you cannot use conditional formatting rules that reference other worksheets. In this case, use the helper column and set your formatting rule in column A like:
=B1="Duplicate"
This screenshot is from the 2010 UI, but the same rule should work in 2007/2003 Excel.

Highlight Rows in Sheet1 that match values in Sheet2

It's been a long time since I've done anything advanced in Excel. I have Excel 2010. I've watch many videos and tried some tutorials that do sort of what I'm looking for, but I'm just missing something.
This is what I'm trying to accomplish... I have a list of about 50 SKUs in Sheet2. I have a complete list of 200 Products in Sheet1.
SHEET1:
ColA are SKUs
ColB is Desc
ColC is Price
SHEET2:
ColA are SKUs
I need a formula or Macro that will look at all SKUs in Sheet2, then find any matches in Sheet1 ColA, then highlight the rows where there is a match.
I would really appreciate any help you can provide, even if it's just a link to an exact example. Thank you!
If you just want to mark matching rows you can do something easy. This will return matching SKUs, or #N/A if no match:
=VLOOKUP(A2,Sheet2!$A:$A,1,FALSE)
If you really want highlighting you could use the helper formula above and set up conditional formatting (CF) over the range. The CF formula will be something like
=NOT(ISNA($D2)) (assuming you put the VLOOKUPs in column D)
There is another way to do CF that uses no helper formula. First you need to set up a named range on Sheet2 A:A. I'll call it SKUs in this example.
Then a CF formula like this will tag matching rows:
=MATCH($A2,SKUs,0)>0
Edit: I am assuming the data (and CF range if you use that) starts in row 2, allowing for a header in row 1.
This may be a little late, but I figured I would still add my 2 cents. I use the following formula to do something similar...
=IFERROR(IF(VLOOKUP(B1,Sheet2!$A:$A,1,FALSE)>0,"Y","N"),"N")
Basically I just have a column of Y or N for if that item is also on "Sheet2" and this is the formula that decides whether it is a Y or N.
Just use your VLOOKUP() along with IFERROR() in a conditional format formula.
Select the range you would like to apply conditional formatting then do Home -> Conditional Formatting (in 2007) then "Apply a formula".
Then you'll want to apply a formula more or less like this one:
=IF(IFERROR(VLOOKUP($A2, Sheet2!$D$2:$D$4, 1, 0)), 0, 1)
Just adapt the ranges to your needs. I tested this to work on 2007.
You can use conditional formatting in Excel 2010 to achieve what you want to do.
There are 2 ways to do this. The first one works only with the ranges in one sheet whereas the second one lets you work across sheets.
Assuming you can copy and paste both the ranges in one worksheet, you can select both ranges using Control key. After selecting the ranges, Go to Home->Conditional Formatting->Highlight Cell Rules->Duplicate Values. Now Select Duplicate in the dialog box and it should highlight the names in Range 1 that are appearing in Range 2 (your original SKU list).
If you can't copy and paste the second range into the same worksheet, then you have to use a formula with conditional formatting. Select the used range in ColA in sheet1, Go to Home->Conditional Formatting->New Rule. Now Select the Rule Type 'Use a formula to determine which cells to format'. Now type the formula like this (this formula assumes that your cursor is in A1 when you apply invoke the dialog)
=COUNTIF(Sheet2!$A$1:$A$3,Sheet1!A1)
That should highlight in Sheet1 all the items found in Sheet2. Edit the above formula to include the correct range for your situation and use a dynamic range if you know how to do it.
I have used approach 1 countless times and I have just tested approach 2 with a sample and it works. If they don't work for you, please let me know and I can help you further.

Resources