Conditional formatting cells with lowest value per row excluding specific columns - excel

I've looked around but haven't been able to find an exact answer to this question without learning everything there is to know about excel formulas.
I'm trying to use one conditional formatting rule to highlight one specific cell in each row in a dataset.
I've got that working with this: =AND(D5<>0,D5<=SMALL(IF($D5:$W5<>0,$D5:$W5),1))
The next part is having the formula exclude hidden columns/columns that have the header "USA" for that I have this formula: =SEARCH("US",D3)=1
Which works to highlight the cells with USA written in them.
I need to combine these two formulas to have it highlight the single lowest value in each visible row.
On a separate note I then want the highlighted value displayed at the end of the data set. This way if I update the document with a lower price it will automatically update the rest of the sheet with this information.

I am not sure of your ultimate objective (eg mention of hidden columns/columns that have the header "USA" - is that one condition or two? - and each visible row - is that because part of each row is hidden or are rows hidden as well as columns?) but your immediate requirement seems to be to combine two formulae into one for CF and for that the following may suit, assuming from D5 to Wn is selected first:
=AND(D$3<>"USA",D5<>0,D5<=SMALL(IF($D5:$W5<>0,$D5:$W5),1))

Related

Conditional formatting based on the content of a formula

Long story short: My boss has an Excel spreadsheet for calculating product prices. She has three columns to calculate different margins (so would contain a formula like =cost*.5 etc.), then adds to those values to determine final retail (so would be =column+500). She has her margin columns highlighted different colors and wanted to automatically highlight the final retail cell based on which margin column it references.
I'm sure there's a way of setting up the document from the start that makes this more intuitive, but short of restructuring her entire system, are there any formulas I could use in combination to return a format based on the content of the formula?
I immediately assumed to use "if cell contains specific text" and use the referenced column letter as the text, but excel reads the output for the formatting and not the formula, so I am stumped.
I was thinking somehow to use "isformula", but all the values are formulas just with different input.
Suppose you made table of all the unique formulas that are used:
formula_test, rule,
=cost*0.5,1
=column+500,2
Then you could create conditional formatting rules by formula with one for each unique formula case.
=VLOOKUP(FORMULATEXT(A1),$A$2:$B$3,2,FALSE)=1
=VLOOKUP(FORMULATEXT(A1),$A$2:$B$3,2,FALSE)=2
Where A1 is the first cell in the range where you want the conditional formatting to be applied.
The missing link was "SEARCH":
=SEARCH("=Sum(J",FORMULATEXT(N2))
(J = the referenced margin column, N2 = first cell to apply the final retail formula)

Excel formula help needed highligh based on data validation list in cell

I have many columns with different Data Validation lists so clients can select the correct options.
Each is column specific and doesn't link to another column or cell.
These lists are typed into the Data Validation list option, and they do not exist on the spreadsheet themselves to be selected as a range in the Data Validation list option.
Example: (this is simplified, I have about 40 country codes in this list)
Column A header in Row 1 is Country Code.
Rows 2-10 have a list of: USA,AUS,CAN,GBR,PRI .... etc.
What I need to do when any of the below applies:
If any option from the list is not selected the cell turns red.
Case sensitive. Must be all caps, so if they paste "usa", instead of "USA" the cell becomes red so they know what they did is invalid.
Ensure that if no data is in column B in the same row, that column A can be blank (for this I generally use =A2="" highlight the needed range, and format no fill no boarder etc. If that needs to changed based on any possible formulas for the other requirements, please let me know.)
I have figured out the formula for these requirements if I use a list range of the data on another tab. =MATCH(TRUE,EXACT(A2,Sheet1!$A$2:$A$10),1)
But, are there formulas that I can use to do this with the existing Data Validation lists without having to re-create the lists on another tab of the spreadsheet?
Or, is creating the lists on another tab the only way to accomplish this?
Issue 1 can be solved with Conditional Formatting. New rule, format only cells that contain, Format only cells with: Blanks, set format fill to red.
OR
Issue 1 and 2 can be solved with Data validation, Allow: List, Source = $A$2:$A$41 (or the correct location if you move the selections to a new tab). This way their only option is to select valid choices.
I'm not sure what you are asking for with issue 3

Select all data in Excel by column name, omitting empty cells

The goal is to create a series of graphs that will update automatically based on the raw data.
So, I have created a graph manually and want to edit the formula to accomplish the auto update.
The column names will always be the same, so I want to be able to select all data in a column based on the name BUT ignore any cell that is blank (above zero maybe).
The formula excel has given me so far is
=SERIES(rawdata!$M$1:$M$6,rawdata!$A$2:$A$37,rawdata!$M$2:$M$37,1)
So, something like
=SERIES(rawdata![column name],rawdata![column name],rawdata![column name],1)
I'm not sure how the skipping blank columns should work either. To expand on this further only one of the columns can potentially contain blank values. So if a cell is blank in that column then that entire row shouldn't be plotted, if that makes sense!
strong text =OFFSET(Sheet1!$B$2,0,0,COUNTA(Sheet1!$B:$B) - 1)
Try this formula when you define the name for the column of values you would like to have data automatically added from. I know it works when each cell has either a formula or a value. Like a column that is automatically calculated based on values in other columns.
In this formula example the cell B2 refers to the first point of data in the column. (make sure your references are absolute! ie, use $B$2)
This automatically returns the range of data as it changes when CountA is added:
=OFFSET(reference, rows, cols, [height], [width])
=COUNTA(value1, [value2], ...)
Hope this helps! It worked for me! :) If you have completely blank cells in the column you might have to make a couple changes though.
-Reverus

Excel Conditional Formatting - Text contained in List?

Another Excel Conditional formatting, haven't been able to find a relevant answer yet.
I have two sheets with data. Sheet2 has simple list of finished items (all in Column B). The Sheet1 has a table of when an item needs to be done according to date - each new column is a date, and the rows underneath have items to be finished. I am hoping to have the items in Sheet1 be colored green once they are added to the finished list in Sheet2. The table in Sheet1 is tied to other spreadsheets, and updates daily, so I need something that is fluid (ie, I can't manually color the cells, as the item to be finished might change dates).
I have gotten this to work for single columns at a time using "=MATCH(B4, 'Sheet2'!B:B)" (for column B on sheet 1, where the items I need formatted begin on row 4). However, I can't enter in this conditional formatting for every column (well, I'd rather not). Is there a way to have every cell in Sheet1B4:Z41 look at Sheet2B:B, detect if that value is in Sheet2, and then be formatted (colored) appropriately?
Let me know if I need to clarify this more, busy day and I'm writing fast.
Thanks!
All you need to do is make the lookup range an absolute reference, i.e.
=MATCH(B4, 'Sheet2'!$B:$B, 0)
Conditional formatting rules also adhere to absolute and relative references so if you apply a rule A1=B1 to a range A1:C3 then C3 will check if C3=D3, in this case C4 checked Sheet2!C:C.
You should also use 0 for good measure unless you know the elements in Sheet2!B:B are ordered and a subset of elements in Sheet1.

Is it possible to use conditional formatting to format multiple columns based on a formula

I'm currently making a spreadsheet with a bunch of parameters. However, some sets of data will not have to include these parameters, so I want to be able to apply a greyfill color to multiple columns based on a "No" appearing in a different column. So far, I've been able to only get this formatting to apply to one other column at a time, and I must duplicate the rule for every additional column I want it to apply to. I got it to work so far by using the formula rule =H1:H10000="N", but when I choose to apply this to $K:$Q it will only grey out the relative rows in column K
Select your range
check the row of the active cell (1 in this example):
Enter the following formula in your conditional formatting (replace 1 by the active cell's row):
=$H1="N"
And that should do what you need.

Resources