I am trying to figure out how to make a top n list of the most common textvalue in an excel spreadsheet based og 2 criterias (between dates and text).
Assuming i have a list as shown in image below. In columnE i want to be able to list the top n colors from columnB based on the criteria that it's a Bmw (columnA) sold within 2017 (ColumnC)
Hope someone can help !
If you are happy to use Pivot Tables, here's a way to achieve this:
Use Sold Date as filter, Car in Columns and Colour as Rows. Then have Count of Colour as Values.
On the row Labels filter, use Value filter and at the bottom you have Top 10... which you can set to top 3.
Following might be helpful.
In Cell G2 enter following formula
=IFERROR(INDEX($B$2:$B$14,MODE(IF(A$2:A$14=E2,IF(YEAR(C$2:C$14)=F2,MATCH(B$2:B$14,B$2:B$14,{0,0}))))),"")
In Cell H2 enter
=IFERROR(INDEX(B$2:B$14,MODE(IF((A$2:A$14=E2)*(YEAR(C$2:C$14)=F2)*
(B$2:B$14<>INDEX(B$2:B$14,MODE(IF(A$2:A$14=E2,IF(YEAR(C$2:C$14)=F2,MATCH(B$2:B$14,B$2:B$14,{0,0})))))),MATCH(B$2:B$14,B$2:B$14,{0,0})))),"")
In Cell I2 enter the below formula
=IFERROR(INDEX(B$2:B$14,MODE(IF(((A$2:A$14=E2)*(YEAR(C$2:C$14)=F2)*
(B$2:B$14<>INDEX(B$2:B$14,MODE(IF(A$2:A$14=E2,IF(YEAR(C$2:C$14)=F2,MATCH(B$2:B$14,B$2:B$14,{0,0}))))))*
(B$2:B$14<>INDEX(B$2:B$14,MODE(IF((A$2:A$14=E2)*(YEAR(C$2:C$14)=F2)*
(B$2:B$14<>INDEX(B$2:B$14,MODE(IF(A$2:A$14=E2,IF(YEAR(C$2:C$14)=F2,MATCH(B$2:B$14,B$2:B$14,{0,0})))))),MATCH(B$2:B$14,B$2:B$14,{0,0})))))),MATCH(B$2:B$14,B$2:B$14,{0,0})))),"")
All the above formulas are array formula so commit by pressing Ctrl+Shift+Enter. Drag/Copy down as required.
Note : In case there's a tie for any position, color appearing first in the range will be the result.
See image for reference.
Related
Hi I am using the following array formula to sum rows AC-AG , I would like to modify it so that it does not sum if an entire row is blank. How would I do this using an array formula since this spreadsheet is tied to a google forum and gets updates often.
I am using this formula at the top of the column.
={"# Boxes of Household Items"; ARRAYFORMULA(SUMIF(IF(COLUMN(AC1:AG1),ROW(AC2:AG)),ROW(AC2:AG),AC2:AG))}
Example Below
The Formula adds up AC through AG and puts them in AR.
I want the formula to not put a zero in AR5 since the entire row is blank
In the image above I have numbers in various cells from columns A:E, then I have a formula in cells F1:F3.
Row 1 has numbers for all cells.
Row 2 has numbers for some cells.
Row 3 has no numbers.
To show the sum when all/some of the cells contain numbers, I would do:
=IF(COUNT(A1:E1)>0,SUM(A1:E1),"")
We check IF there is at least one number using COUNT(A1:E1)>0. If there is at least one number, we then show the sum using SUM(A1:E1) otherwise we just show nothing, which is the "" part.
For you the formula would be this in AR2:
=IF(COUNT(AC2:AG2)>0,SUM(AC2:AG2),"")
enter image description hereI have a list of certain items. And I want to make combinations of the items manually.
And what I want to do is, If any 3 cell matches of a row with the previous entries, then those cells should be highlighted.
For example, I have Column A B C D and E.
In row4, I have items- Nickel, Potassium, Gold, Calcium, Magnesium.
Now If I add Potassium, Calcium, Magnesium to the next rows then all the matching items should be highlighted.
Any help will be appreciated.
Attached screenshot
Use conditional formatting, Format cells where this formula is true.
=Countif($A2:$D2,A3)
I applied this format to cell A3 and copied the format to other cells using the format painter. However, there are several other ways of achieving the same result.
This is my first post and I've been searching forever but need some help.
I have a spreadsheet that contains Stock Codes in column A for 153 rows (A2:A153) and dates in columns F through BL that list the quantity for each Stock so, for example, it looks like this linked image:
The issue is that there are a ton of rows that have Quantities of just 0, I want to use conditional formatting to highlight ANY row that contains a number greater than 0 in ANY of its columns.
So for example if Row 5 has a 7 in Z5, even if every other column is 0, then the entire row highlights green.
Likewise, if every column for Row 5 (A-BL) is 0 then it doesn't highlighted.
I thought this would be easy but I'm struggling so any help would be appreciated.
Thanks!
Here's what you'll need to do:
Select cell A1
Click "Conditional Formatting" -> "New rule"
"Use a formula to determine which cells to format"
Type the formula =COUNTIF(1:1, ">0")
Choose the formatting you want
Click OK, then go to "Conditional Formatting" -> "Manage Rules"
Change the area your rule applies to so that it fits whatever rows you want (ex 1:1000)
Here's a GIF showing the steps
EDIT: To get the rule to include negative numbers, just change the formula to =OR(COUNTIF(1:1,">0"),COUNTIF(1:1,"<0"))
If you played with multiple rules and tweaked them a bit you could even get the row to highlight red if the average of all numbers in the row is negative and green if it's positive.
Try:
=IF(OR(COUNTIF($A1:$D1,"<0")>0,SUM($A1:$D1)=0),FALSE,TRUE)
I tried by selecting range then conditional formatting then cell value equal to then =large($C:$E,1) THEN fill golden color for 1st highest value. This formula applies to entire columns. I need help with applying formula within range i.e from 31 t0 41. I have values in column C i.e c31:c41 and column E i.e E31:E41 in percentage . I want golden color for 1st ,silver for 2nd and yellow for 3rd highest of two columns. Column D has names so column D can not be selected.
SAMPLE EXCEL FILE
sample data
C D E
2.54% vinu 5.69%
119.90% anand 157.34%
49.32% tanaji 7.39%
82.28% umesh 121.21%
-21.66% chandu 94.10%
-60.45% rajan -25.71%
-20.12% mule 37.02%
-16.05% jafgtap 31.085%
-3.50% kunal 282.62%
-3.27% ramesh 14.58%
-8.12% rajesh 5.86%
Select the cells C31:C41 and insert a new formatting rule using a formula. This is the formula if your data starts in row 31 and the active cell is C31.
=C31=LARGE($C$31:$E$41,1)
Note the placement of the $ signs. It is important. Format this to be gold, then
create two more rules with 2 and 3 as the last parameter for silver and bronze.
If the currently selected cell is on a different row than row 31, use the respective row number. My screenshot starts with row 1.
Select the cells in the worksheet, click the Format Painter on the Home ribbon and select cell E1 to apply the same rule to the cells in column E. In the screenshot I changed your sample numbers so column C has the third highest value.
Edit after comment:
If you explicitly want to exclude the values in column D, you can perform the Large() function on a limited list of ranges like this:
=LARGE(($C$31:$C$41,$E$31:$E$41),1)
Unfortunately, Conditional Formatting rules will not accept formulas with that level of complexity. The solution is to create three defined names with these formulas:
Gold =LARGE((Sheet11!$C$31:$C$41,Sheet11!$E$31:$E$41),1)
Silver =LARGE((Sheet11!$C$31:$C$41,Sheet11!$E$31:$E$41),2)
Bronze =LARGE((Sheet11!$C$31:$C$41,Sheet11!$E$31:$E$41),3)
Then you can use three conditional formatting rules that compare the value in the range with the values of the defined names Gold, Silver and Bronze
This post has been quiet for a while, but maybe you can help me.
I have a large file with criteria across the top, labels on the left and scores in the middle. I've correctly modified the formula above for row based eval.
=B2=LARGE($B2:$X2,1) and =B2=LARGE($B2:$X2,2) and =B2=LARGE($B2:$X2,3)
I've noticed that if there are joint second largest values, then the third one doesn't work, and but the 4th one does work. It's not a major pain.
What I want to do now is apply the conditional formatting for the second row to all other rows (about 40). I can't see a way to copy the conditional formatting and I don't really want to enter the three of them 40 times.
Any ideas?
Thanks
I am referring to below my google spreadsheet
https://docs.google.com/spreadsheets/d/1dCfShenhV2j98q5wkOXMeyWj9tlMZbaBgBqB2vAPdHo/edit?usp=sharing
I am looking to update H,I and J columns using vlook formula in way that it should match both name and date values in my data range, which in A,B and C columns
Here is the issue I am facing with normal vlookup is that I can check only name.It is ignoring the date and updating the vlooked up data on all date column.
Eg: Alpha and date 20141120 value is 10, it should fill only H3, but it is updating, H3 I3 and J3 with value 10
I really appreciate your answer on this problem!!!
you can use this formula of index and match:
=IFERROR(INDEX($A:$C,MATCH(1,($A:$A=$G3)*($B:$B=H$2),0),3),"")
paste it in the first cell of your table H3, and drag and fill to the right and then select the entire row and fill down till end.
it should work.
if error(();"") : you will get empty cells if there is no match.
this is an array formula, so press ctrl+shift+enter to calculate the formula
UPDATE: here is [the example sheet downloadable from here}(https://www.dropbox.com/s/clqxsj5j4bdk27b/indexmatch.xlsx?dl=0)
Basically you need to concatenate the results, then use a VLOOKUP on that.
I.e. insert a column between B and C, with formula "=CONCATENATE(A2,B2)"
In the range you want to update, use the column and row headings for you lookup
"=VLOOKUP(CONCATENATE($g3,h$2),$c$1:$d$3,2,false)"
You want to perform a Multiple Lookup (see this).
As indicated there, enter
=IFERROR(LOOKUP(2,1/($A$1:$A$3=$G3)/($B$1:$B$3=H$2),$C$1:$C$3),"")
in H3. Copy into H3:J5.
This avoids array formulas.