In an Excel spreadsheet I count the blank rows between two rows with values. I use the MATCH formula. Now I need to get the largest number into the st column.
I have a solution to get the row numbers (of the rows with cells) and create array as text (e.g. =MAX(W"&N2&":W"&O2&").
I cannot get the value from cell AK to be a real formula. I do not want to go for VBA, this would make things too complicated.
Any ideas how to do this?
Use INDEX():
=MAX(INDEX(W:W,N2):INDEX(W:W,O2))
Entirely different interpretation (based on screenshot), in Row2 and copied down to suit:
=IF(J2<>"",MAX(OFFSET(K2,,,L2)),"")
Related
I need to sum Amount for all the dates if there is value in India row:
I tried implementing with COUNTIF function but its not solving my problem, any suggestion welcome, I am pretty new to Excel formulas.
Try this.
Let's assume the top left cell on your image is cell "A1". Go to cell "C6" and paste the following formula:
=IF(C2>0,C2*(SUM(C4:C5)),"")
Now fill/copy that formula across to cell "G6". Then go to cell "H6" and paste the following formula:
=SUM(C6:G6)
Hope this helps.
What about this:
=SUMPRODUCT(C2:E2+C3:E3,C4:E4+C5:E5)
It's basically adding the two first rows, adding third and fourth rows, and taking the sumproduct. Obviously, you need to make sure not have a number in both rows one and two, and in both rows three and four.
I have a table in Excel with multiple rows. for example in cell A2 I have formula (=B3). The problem is if I sort the table. After sorting the row 3 moves to different row (example 5) but the formula remains the same = (=B3).
Is there a way so that even if I sort the table the formula gets the value from the proper cell in row?
this maybe simple but could not figure out. hope you can help.
You can prefix the sheet name. For example instead of "=B3" use "=Sheet1!B3", then the formula will not change after sorting.
Suppose I have a simple spreadsheet with 3 rows of data that I want to rank in separate columns. The example I will use is simple, but my actual dataset is 12k + rows. In this simple example, I want to use the RANK formula from Excel to do this. To rank the values in column Police, I'll use the formula =RANK(B2, B2:B11, 1), with B2:B11 being the range.
As I mentioned, my actual dataset has thousands of rows and many more columns to compare. Even in this example, I want a simple way to copy the formula to all of the other _RANK column cells. If I simply copy the cell to the other cells, +1 gets added to the cell value. This is what I want to happen, EXCEPT for the ending cell of the range.
As you can see above, this is incorrect. The formula gets set to =RANK(B11,B11:B20,1) for cell E11, when what I want is =RANK(B11,B11:B11,1). How can I easily copy this formula across multiple cells so that it is has the correct formula?
Placing $ before the cell references makes it static. Try changing your formula to Rank(B11, B$2:B$20,1). Coping this formula will only change those references which are not proceeded with $.
Not really an Excel user, but what seemed simple has turned out to be very difficult for me. I am in trouble as I can't come up with a nice and clean (or any) way to get it working.
What I have here:
I need to create a new columnn that would tell the amount of employees in each occupation while ignoring the duplicates (highlighted).
The amount of names formula is working, so maybe this can be used ? Or maybe it's just in the way and should be cleared.
It's just:
=COUNTIFS(A:A;A2)
Tried searching for quite a while did not find anything suitable. Any help or advice would be much appreciated. I hope I explained it in clear manner.
Thank you
Without helper columns:
Two options, D2:
{=SUM(--(FREQUENCY(IF($B$2:$B$9=C2,MATCH($A$2:$A$9,$A$2:$A$9,0)),ROW($A$2:$A$9)-ROW($D$1)+1)>0))}
Or put in E2:
{=SUMPRODUCT((($B$2:$B$9=C2))/COUNTIFS($B$2:$B$9,$B$2:$B$9&"",$A$2:$A$9,$A$2:$A$9&""))}
Notice both are array formulas and should be entered through CtrlShiftEnter
SUMPRODUCT 'Deals' in Arrays 3
You might have employees with the same name (David, Michael) in different occupations (Tech & Worker, Tech & Economy). To distinguish those from each other, in B2 you can use:
=SUMPRODUCT((A$2:A$21=A2)*(C$2:C$21=C2))
In D2 you can use:
=SUMPRODUCT((1/B$2:B$21)*(C$2:C$21=C2))
Distinct Employees Occupation Count
with a helper column
Unique and Distinct values are tricky. Using a helper column is beneficial for identifying either one of these when coupled with an expanding range:
=SUMPRODUCT((A2=$A$1:$A1)*(C2=$C$1:$C1))
Relative Rows: ^ ^
Paste to cell E2.
Copy Drag the formula down from the where pasted.
The relative row numbers identified above well increase as the formula is copy dragged down. This creates a larger and larger range for comparison. An expanding range.
In this case the range that is expanding is the range of already checked values. Many times the result range is expanded and tested against to eliminate posting duplicates of already posted results in subsequent rows of the results list.
The helper column's value is how many times the name and occupation pair has previously appeared. Zero previous appearances tells us this is the first occurance. We will only count the zeros (first occurance) in the main formula.
The main formula for counting distinct employees in each occupation:
=COUNTIFS( $C$2:$C$9, C2, $E$2:$E$9, 0)
Paste to cell D2.
Copy Drag the formula down from the where pasted.
Here we count all the rows for this row's occupation where the occupation matches the range of listed occupations and for that particular row in the list of occupations, the helper column row value is zero.
Add a final column which is the concatenation of the prior 3 columns then use
=SUMPRODUCT(1/COUNTIF(D2:D9,D2:D9))
There is a good explanation of this formula here. Basically, values that appear once will count as 1. Values that appear more than once will appear as fractions of their total occurrence count and be summed to 1.
If you convert your data to an Excel table by selecting a populated cell in the range and pressing Ctrl+T, then formulas will auto-populate down last column. You can then reference the table columns in the formula and you won't need to amend the formula as you add rows.
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.