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
Related
I'm hoping someone can help me make better use of the INDIRECT formula.
I have a list of sheet names in a table and an INDIRECT formula that uses that list to return a value in a specified cell - the list of sheet names is just an easier way for me to drag the formula down the table and read the appropriate cells without having to manually link each sheet.
=INDIRECT("'"&A2&"'!"&"K10")
This works fine for single cells as the range ref is simply stated as the text in the formula (K10), the problem arises when I need to start referring to a range such as K10:K15 and summing the values.
The range K10:K15 will inevitably have new rows added or deleted on the relative tab and as INDIRECT is using text as the reference it means the range doesn't automatically adjust - this is as I understand it one of the 'benefits' of INDIRECT but in this case is actually holding me back.
Also worth noting that the range (K10:K15) may move as rows are added/deleted above this, as this range is part of a larger table.
In simplistic terms I want to achieve the same result as a standard reference to a range on another sheet, e.g. =sum(sheet1!K10:K15) (as this will adjust when rows are added/deleted) but I just want to be able to dictate which sheet is referred to via a list I have in a table on a summary sheet.
How do I either write INDIRECT so the range adjusts when new rows are added/deleted or is there a different formula I should be using that achieves this?
Any advice greatly appreciated :)
=INDIRECT("'"&A2&"'!K"& MATCH(TRUE,INDIRECT("'"&A2&"'!K:K")<>"",0)&":K"&MAX((INDIRECT("'"&A2&"'!K:K")<>"")*(ROW(INDIRECT("'"&A2&"'!K:K")))))
This indirectly references the rows from the first non empty cell up to the last non empty cell in given sheet in column K. Not sure if you need to enter with ctrl + shift + enter (not in the app version).
Note: If the range contains empty cells in between the first and last non empty cell it will be included as value 0
Or in office 365 use the following:
=FILTER(INDIRECT("'"&A2&"'!K:K"),INDIRECT("'"&A2&"'!K:K")<>"")
My SUMIFS formula criteria is based on a cell (say A1) that is data validated by list and changed via selection by user. If cell has data inside text or number by selection from drop down list, SUMIFS formula is considering that data as criteria to calculate the related sum. If criteria cell is left blank, I want formula to sum everything without any condition. My problem here; in criteria field of SUMIFS formula, I typed if condition like; SUMIFS(sum-range,criteria_range,IF(A1<>"",A1,"*")) but in this case excel considers only text values and do not include cells containing number. Briefly, if nothing selected in A1, I want SUMIFS formula to sum everything without any condition, numbers, texts and even blank cells. How can we proceed to do that?
EDIT:
Here an example for data and formula, what is expected is actually to disable criteria if one of selection is blank on left. Harun's suggestion works but if there is blank cell in criteria range, then in this case it won't consider those values in sum. For instance, if we select from left Phone/smart/touch, then how can we get "2" as output no matter what is in cri_range4 cells? Thanks
Example:
How about this solution? It basically ignores a missing entry in column C and evaluates only the other two. (Your example formula has a fourth criterium that isn't apparent in your list but the method can be extended for as many criteria as you might have.
=SUMPRODUCT((IF(LEN(C2),(INDEX(Lists,,1)=C2),TRUE))*(IF(LEN(C3),(INDEX(Lists,,2)=C3),TRUE))*(IF(LEN(C4),(INDEX(Lists,,3)=C4),TRUE))*SumRange)
For better readability I created a named range Lists which comprises your sample range E2:H10 while I named I2:I10 as SumRange'. INDEX(Lists,,1}` refers to the first column of the range. It's important that SumRange and Lists have the same number of rows.
If A1 is blank then just use not equal operator to sum all cells that are not blank. Try below.
=SUMIFS(D1:D5,C1:C5,IF(A1<>"",A1,"<>"))
Edit: can you check below formula in D3 cell then drag down.
=IF(C2="",SUM($I$2:$I$10),SUMPRODUCT(($E$2:$H$10=C2)*($I$2:$I$10)))
I have an array of numbers in Excel spanning from Cells B1 to F49. Out of all those numbers I want to find out the unique values, in other words, no duplicates. I tried using Remove duplicates but it looks at the rows and not the individual cells. What would be my best option for doing this? any help would be greatly appreciated.
You could try this array formula that returns unique text or numbers from a rectangular range.
Select a range to output the results to eg: H1:H245
Copy and paste the formula below into the formula bar.
Press Ctrl+Shift+Enter to enter into the range.
=IFERROR(CELL("Contents",INDIRECT(T(IF(1,TEXT(MODE.MULT(IF(FREQUENCY(COUNTIF(B1:F49,"<="&B1:F49)+ISTEXT(B1:F49)*COUNT(B1:F49),COUNTIF(B1:F49,"<="&B1:F49)+ISTEXT(B1:F49)*COUNT(B1:F49))>={1,1},MODE.MULT(10^5*ROW(B1:F49)+COLUMN(B1:F49),10^5*ROW(B1:F49)+COLUMN(B1:F49)))),"r0c00000"))),0)),"")
I'd probably put this formula in column C: (or another empty column you have):
(so starting in cell C1: )
=COUNTIF(B:B,B1)=1
(and copy/paste the formula down)
It will return TRUE if it is unique. So you can then filter things out via Filter, or with other formulas down the road.
It may be easiest to just combine your information into one long column and run a remove duplicates. If this is not an option you may want to look at writing a macro to crawl through the records.
You could have a macro go through each column for the rows specified and determine if the CountIf function =COUNTIF(B2:F49,B2) returns a value >1
if it does there are at least 2 instances of this number.
I'm not sure how you want to identify your unique cells but you could potentially set a text color or return the values of the cell to another location.
Simplest for identification of values unique within the entire array may be to highlight the entire range with ‘standard’ formatting of choice for uniques, then select the entire range, Conditional Formatting, Highlight Cell Rules, Duplicate Values…, and choose a custom format of no fill and font of whatever you started with.
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.
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.