Comparing numbers on multiple columns (Google Spreadsheet) - google-sheets

I'm making a spreadsheet on google docs, listing prices of different products from different sources.
Then I want to compare each of the product's price and format the cell background color where the product is cheaper (my real problem here).
For now, it has 3 columns (B, D and F), from row 3 up to 18.
Each row is a product, and each column is a different "store".
I have searched for 2 hours now and I can't find anything close to this. Every question I found is about comparing an array to a single cell, not row to row, including multiple columns.
Is there a simple function or custom formula to do this?

Please try clearing formatting from and selecting ColumnsB:F and Format, Conditional formatting..., Format cells if... Custom formula is and:
=and(B1<>"",B1=min($B1,$D1,$F1))
Then select formatting of choice and Done.

Related

Formula for looking up and filtering data from a sheet

I want to do a complex formula using google sheets:
I have a list of place that will be visited by different people.
Some places are not to be visited, marked with /
Some places need to be assigned, marked with ?
Wanted outcome:
A list of cells that changes every day automatic.
An overview of who is going where that day and what needs to be assigned.
So I need a formula that can select a row based on today() and then filter out Persons in that row. Then for each person, another formula that looks up the first row in the table and puts duplicates together.
Example:
Wanted outcome:
Link to excel file, but it needs to work in google sheets too: xlsx
My solution is not the most elegant but it does the job.
First I build a column with date and unique persons or ? in this column:
=unique(sort(transpose(index(A1:H10,match(today(),A1:A10,0)))))
Then I find Places corresponding to these persons (I use filter function for it and then I use textjoin to keep them in single cell).
The formula is copied down as filter function does not accept a range and arrayformula as a filtering criterium.
My solution is available here:
https://docs.google.com/spreadsheets/d/1GTy_UaFP8LbA8OLnEhT_R_twpDCIWCuvQfBAigqtbR0/copy

Display columns of information in Google Sheets based on Drop down selection

What I am looking to do is have a list of items in a dropdown list in cell A1. Lets say the list is "Presidents, Movie Stars, Rappers".
When I select Presidents I want Column B in Sheet 1 to list all the presidents with column C listing their party they represented and column D to list their years in office. When I select Movie stars I want column B to List various Movie Star names, Column C to list number of movies starred in and Column D to display their highest paid film.
So in short I want 1 dropdown to populate 3 columns worth of data.
Everything I have looked up uses scripts(which I think this is completely doable without using) uses VLOOKUP but has 1 cell worth of data appear(ex, A1 dropdown displays data in A2 but not data in B1:B50, C1:C50, and D1:D50) or doesnt worth with multiple columns of data. I am fine if the data pulls from another sheet I just think there is a better way to do this then filling in 200+ cells with an if:then function based on my selection in cell A1. Anyone know an easy way to do this?
An elegant solution, in my opinion, is to do something like the following:
Create a column (which you can later hide) that has all value combinations, with a delimiter between the values. For example, you could have "Presidents>Barack Obama>Democrat>2008-2016"
Then create a simple function (no VLOOKUP needed!) to pull the individual values by using FIND to findn the location of the delimiters and split the combination.

Google Sheets - Lookup with Mulitple Criteria

Trying to work out formula to look up record from a 2nd Tab based on 3 cell values in current Tab.
Shared example of my sheet here:
https://docs.google.com/spreadsheets/d/1RgOn6KoFpcwc_puxdvYO5NK12RwlRMUBfUdLntQSiC4/edit?usp=sharing
Any help or pointers appreciated. Have been googling for days but can not find specific answer to this situation. Combined with me being some-what a novice isn't helping.
You can concatenate the cell values in the Summary sheet, and also the corresponding values in the Parts sheet, and do an index/match (could also use VLOOKUP with an array expression like {B:B&C:C&D:D,A:A} if you wanted to).
=ArrayFormula(iferror(index(Parts!$A:$A,match($A3&C$2&B$1&C$1,Parts!$B:$B&Parts!$C:$C&Parts!$D:$D,0))))
entered into C3 and pulled across and down.
Note that I have included B1 & C1 in the concatenation. This is because of the merged cells - the right-hand cell in each merged pair in the Section cells will always be empty, so this guarantees that a non-empty string will be used.
In principle you could develop a single array formula to fill all the cells, but that would probably be overkill.
Here is the Vlookup version for comparison
=ArrayFormula(iferror(vlookup($A3&C$2&B$1&C$1,{Parts!$B:$B&Parts!$C:$C&Parts!$D:$D,Parts!$A:$A},2,false)))
For the record, a single array formula wouldn't be any longer:
=ArrayFormula(iferror(vlookup(A3:A5&B2:I2&A1:H1&B1:I1,{Parts!B:B&Parts!C:C&Parts!D:D,Parts!A:A},2,false)))

match values from a range into each row of a table in Google Sheets

I've been working on a multi tiered drop down program, and in filtering one of the tables I stumbled upon a problem I can't find any help on.
Basically, I have 2 sheets. Sheet1!A2:A has a set of values. In this example, A2=110, A3=114, A4=162. However, with each use of the program, there could be any number of values and the values could change.
In the second sheet, Sheet2! there is a table. The first row has the headers that I want to return from my search. Under each header is a series of numbers ranging from 3 to well over 50 values. And the number of columns is also unknown...(it will keep getting larger).
So I want to know which columns have all 3 values from Sheet1!A2:A in them.
Column 3 might have 6 numbers (95,110,114,125,150,162) and column 7 might have (80,110,114,125) so I would want to return the header from Column 3 but not from column 7.
Does any of this make sense? Again in simple terms, I want to query all of the columns in Sheet2 to see which contain all of the values from Sheet1!A2:A
Any help would be so greatly appreciated...
-Daniel
I set up an sheet using your example data:
https://docs.google.com/spreadsheets/d/169VrbWkTlRMzhNPe4G8hQL1MdfqQuTvjb87aRD9hiWo/edit#gid=1923440782
I've restricted the formula in cell D2 to 500 rows for the sake of speed but you can remove the references to make it work across the whole sheet:
=FILTER(Sheet2!1:1,ArrayFormula(TRANSPOSE(mmult(TRANSPOSE(COUNTIF(A2:A500,Sheet2!A2:Z500)),TRANSPOSE(split(rept("1,",COLUMNS(TRANSPOSE(COUNTIF(A2:A500,Sheet2!A2:Z500)))),",")))=count(A2:A500))))

Format cells based on current value and another one

Sheet regarding this question.
I have a set of sheets where each person must use a drop down box to select a house they would like to view. We can easily add a house to the list by inserting the address, and a URL into the "houses" sheet and it will be shown in the dropdown list and the results table.
Everything works so far, but if a house becomes unavailable, I want to mark it unavailable on the "houses" sheet, and then all occurrences of that specific house in the dropdown cells and results section should have a red background.
I could use conditional formatting, but this would require me to apply a different formula to each cell and that wouldn't be practical.
I regret not elegant but I think your layout is not well suited to Google Sheets' strengths. The best I can suggest is in say J2 of sheet Choices:
=vlookup(B2,Houses!$A:$C,3,0)
copied down to J30 and J2:J9 copied across to ColumnN. Then select Choices ColumnsB:F and Format - Conditional formatting..., Custom formula is and:
=J1="No"
with formatting of red background Done.
You might want to hide columns J:N.
You should just use conditional formatting.
Step 1: Select Cell B2, go to conditional formatting and create a new rule, "Use a formula to determine which cells to format".
Step 2: Use the following formula:
=VLOOKUP(B2,Houses!$A$3:$C$42,3,FALSE)="No"
Note: This B2 value since it isn't using $, moves dynamically depending on what cells your formula is applied to. The VLOOKUP looks up the B2 value in the depicted range and returns the 'Available' column (column 3 on the Houses sheet). We're matching on "No" specifically, I believe its case sensitive so watch out for that caveat.
Step 3: Set your format to Red.
Step 4: Make sure your 'Applies to' box is pointed to the following range:
=$B$2:$F$9
Personally I hate hard coded ranges like these, you should look into dynamic named ranges. That way you can just reference a named range instead of the A3:C42 range for both your Data Validation dropdown as well as these formulas.

Resources