worksheet-function

How to find the first and second maximum number?

让人想犯罪 __ 提交于 2019-11-29 23:09:42
I am trying to find first highest number and second highest number in excel. What shall i do for that. I did not find the right formula. Note: I have already used the large and max formula. =LARGE(E4:E9;1) edit: guys I know if i write 2 instead of 1 i will get the result but i have to click the mouse to see all result. If you want the second highest number you can use =LARGE(E4:E9;2) although that doesn't account for duplicates so you could get the same result as the Max If you want the largest number that is smaller than the maximum number you can use this version =LARGE(E4:E9;COUNTIF(E4:E9

Excel function to get first word from sentence in other cell

南楼画角 提交于 2019-11-29 17:19:43
问题 Excel: What function can I use to take the all the characters from the beginning to the first '<". I am trying to strip out the first word from A1 and put it into B1 Eg: A1 Toronto<b> is nice I want "Toronto" in the next cell. Ian 回答1: How about something like =LEFT(A1,SEARCH(" ",A1)-1) or =LEFT(A1,SEARCH("<b>",A1)-1) Have a look at MS Excel: Search Function and Excel 2007 LEFT Function 回答2: If you want to cater to 1-word cell, use this... based upon astander's =IFERROR(LEFT(A1,SEARCH(" ",A1)

Finding highest and subsequent values in a range

倖福魔咒の 提交于 2019-11-29 15:21:50
I have the below code which is supposed to find the 1st, 2nd, 3rd, and 4th highest values in a range. It is currently very basic, and I have it providing the values in a MsgBox so I can confirm it is working. However, it only finds the highest and second highest values. The third and fourth values are returned back as 0. What am I missing? Sub Macro1() Dim rng As Range, cell As Range Dim firstVal As Double, secondVal As Double, thirdVal As Double, fourthVal As Double Set rng = [C4:C16] For Each cell In rng If cell.Value > firstVal Then firstVal = cell.Value If cell.Value > secondVal And cell

How do I only count visible rows when using the COUNTIFS function?

家住魔仙堡 提交于 2019-11-29 09:44:07
I've been using Excel's COUNTIFS function to count the number of rows in a table that meet certain criteria, E.g: =COUNTIFS(Table1[Result],"Fail", Table1[Comments], "") Now I want to modify this expression so that it only counts rows in Table1 that are visible. (I.E. Not filtered out.) How can I accomplish this? Simple way is to add another column to table - e.g. called helper with a formula like this =SUBTOTAL(103, B2) where column B is Result column Now change formula to =COUNTIFS(Table1[Result],"Fail", Table1[Comments], "",Table1[Helper],1) the subtotal formula only returns 1 on visible

Excel charts - setting series end dynamically

核能气质少年 提交于 2019-11-28 10:13:53
I've got a spreadsheet with plenty of graphs in it and one sheet with loads of data feeding those graphs. I've plotted the data on each graph using =Sheet1!$C5:$C$3000 This basically just plots the values in C5 to C3000 on a graph. Regularly though I just want to look at a subset of the data i.e. I might just want to look at the first 1000 rows for example. Currently to do this I have to modify the formula in each of my graphs which takes time. Would you know a way to simplify this? Ideally if I could just have a cell on single sheet that it reads in the row number from and plots all the

How to make a reference to a cell of another sheet, when the sheet name is the value of a cell?

心不动则不痛 提交于 2019-11-28 09:17:22
In excel 2007, I have a formula in a cell like the following: =COUNTIFS('2008-10-31'!$C:$C;">="&'$A7) Now I want to make the name of the sheet ('2008-10-31') be dependent on the value of some cell (say A1). Something like: =COUNTIFS(A1!$C:$C;">="&'$A7) // error Is there is way to do this? Or do I have to write a VBA-Macro for it? INDIRECT does what you want. Note that if the sheet name has any spaces, you need to put single quotes round it, ie =COUNTIFS(INDIRECT("'" & A1 & "'!$C:$C"); ">=" & $A7) You are looking for the INDIRECT worksheet function: =INDIRECT("SHEET2!A1") =COUNTIFS(INDIRECT(A1

Finding highest and subsequent values in a range

梦想的初衷 提交于 2019-11-28 09:04:21
问题 I have the below code which is supposed to find the 1st, 2nd, 3rd, and 4th highest values in a range. It is currently very basic, and I have it providing the values in a MsgBox so I can confirm it is working. However, it only finds the highest and second highest values. The third and fourth values are returned back as 0. What am I missing? Sub Macro1() Dim rng As Range, cell As Range Dim firstVal As Double, secondVal As Double, thirdVal As Double, fourthVal As Double Set rng = [C4:C16] For

Get values from other sheet using VBA

旧街凉风 提交于 2019-11-28 08:04:58
I want to get values from other sheets. I have some values in Excel (sheet2) for example: A B C D - - - - 1 | 2 5 9 12 2 | 5 8 4 5 3 | 3 1 2 6 I sum each column in row 4. I'm working with these values in sheet2 but I want to get the result in sheet1. When using my code in sheet2 I get the correct answer but when I try to use it in a different sheet I get the result of the values corresponding to the current sheet cells and not to sheet2. I'm using With Application.WorksheetFunction . How can I set sheet2 as the active sheet? Try ThisWorkbook.Sheets("name of sheet 2").Range("A1") to access a

Excel Select Case?

对着背影说爱祢 提交于 2019-11-28 07:04:40
i want to create the "cases" formula for excel to simulate Select case behavior (with multiple arguments and else optional). If A1 and A2 are excel cells, this is the goal: A1 Case: A2 Formula: A2 Result 5 cases({A1>5,"greather than 5"}, {A1<5, "less than 5"},{else,"equal to 5"}) equal to 5 Hi cases({A1="","there is nothing"},{else,A1}) Hi 1024 cases({5<A1<=10,10},{11<=A1<100,100},{A1>100,1000}) 1000 12 cases({A1=1 to 9, "digit"}, {A1=11|22|33|44|55|66|77|88|99, "11 multiple"}) (empty) 60 cases({A1=1 to 49|51 to 99,"not 50"}) not 50 If it could, It must accept excel formulas or vba code, to

Selecting the max with a condition in excel

你离开我真会死。 提交于 2019-11-28 06:35:43
问题 I have a range in excel with dates and values http://lh4.ggpht.com/_i-hI_3gfy08/SoSIopeZUZI/AAAAAAAABEk/KjFnq57VTUc/table.png EDIT:image added I want to select the MAX value from the HIGH column for each YEAR (2009 would return 404, 2008 would return 390) I've done something similar but it's using SUMIF, not MAX. Any excel people in here that can help me out? 回答1: There are three options available. My preferred option is to create a pivot table without a helper column. Option 1: Use a pivot