I'm creating an invoice at the moment, and there's going to be varying amounts of text on each invoice.
Ideally I'd like to be able to enter content, and as soon as I do that, it'll create a border along the bottom of that row, from A to K if that makes sense.
Is this possible?
Cheers :)
Not strictly programming... you can select the cells from A1 to Kn then go to Format > Conditional Formatting. Select "Formula Is", enter =$A1<>"". Click format and set the border.
Now if you enter a text to a cell in col. A, that row will be underlined up to column K. Not being familiar with invoices I can only hope this is what you wanted :)
Conditional formatting might do the trick for you:
Example #1
Example #2
In your case, (if I understand you right) you would highlight all cells from A1 to K10 (assuming a maximum of ten rows), and then make the conditional formatting formula as follows:
=AND(NOT(ISBLANK(A1)),ISBLANK(A2))
Then just apply the border by setting it up in the "Format..." options as shown in the examples.
Related
I would like to add conditional formatting data bars that show the percentage change based on each value in column E. For example in row 25, E25 would be 0%, D25 would be ~50% and C25 would be ~75%. I want to do this for each row. If it's a negative change then it would show a different color. Is this possible? I have been trying and searching for hours and can't figure it out. Would I have to create a new rule for each set?
Screenshot of Excel report
So you have the formulas that you need. You can apply that formula to the whole column if you like, but start like this...
Select cell D25, then choose Home-->Conditional Formatting-->Manage Rules...
Click "New Rule... " then "Use a formula t determine which cells to format"
Now enter your formula for D25 into the area then choose your format. It's important that your formula evaluate to True/False. Do this by adding ">0" to the end. Mine looked like this:
Next, click "New Rule..." again and enter the same formula, except make it "<0" this time. Your rules should look like this:
From here you should be able to click "OK" and have your data look like this:
WITHOUT CHANGING THE FORMULA, you should be able to extend this formatted area by changing the "Applies To" area next to each rule. For example, make it =$D$25:$D$50 or whatever you need.
Follow the same steps for your other columns. You already have the formulas.
Good luck!
I'd like to create a rule that writes "100%" in column A whenever I write "end" in column B.
So it would be something like this:
[] X
100% end
[] Y
The brackets represent an empty cell.
I've tried:
IF(B1:B3="end",100%,"")
but I would like to leave the cells on column A empty, with no data or formulas, if the respective cell in column B doesn't contain "end".
So I've thought about adding a new rule with conditional formatting but it's not working. Any solutions?
Can be achieved with CF but rather nastily. You would need to fill ColumnA first, say with 1s - but can be hidden by (standard) formatting the text to match the background colour (ie usually white).
Then clear any CF from and select ColumnA, HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=B1="end"
Format..., select Black (probably) font and Custom Number format of:
00%
OK, OK.
If your blank cells must remain blank in reality rather than appearance then CF alone is not a solution for you.
Edit:
You can get a value to show in a cell based on the value of another cell, without having anything* in the cell, and without VBA:
*kinda
Using cells I2:J9 as an example, the steps are:
Click I2, then Ctrl+1 to open the Format Cells dialog.
On the Number tab, click Custom, then in the Type box enter: ;;; and click OK.
Hit Alt+O+D+N to add new Conditional Format and choose Use a formula to determine which
cells to format.
In the Format values where... box, enter: =J2="end" (If Excel adds $'s, remove them), then click Format...
On the Number tab, click Custom, then in the Type box enter: ;;;"100%" . (Optionally set a color, font, etc.) then hit ENTER 3 times to return to the
worksheet.
Click I2, hit your SPACEBAR once and then hit ENTER. (* Fine, I
confess: the cell isn't totally empty.)
Click I2 and hit Ctrl+C to Copy.
Select I2:J9 and press Alt+E+S+T then hit
ENTER to Paste Formats.
Now when you type end into any of J2:J9, the corresponding cell in column I will display 100%.
You can also repeat this process to add additional conditions to the same cells if needed.
Original Answer: (Alternative Solutions)
Sometimes I get stuck spending too much time on a question about a very minor issue. This is one of those times. :)
Thinking further about your question, I suspect you might not have meant you need the "cells on column A empty, with no data or formulas", but perhaps you mean you want the cells to "appear empty".
Example:
These cells do appear empty, unless you to click on the cell and then look at the formula bar:
...but the formula bar can be hidden too:
thanks in advance for the help.
I'm making a Gantt chart in Excel and am trying to integrate the capability to highlight the work week (WW). The idea is that one can select the WW from a drop down menu and the corresponding columns in the chart are highlighted. I am struggling with the conditional formatting formula to highlight the desired dates.
Here's a screen shot of how the chart is set up
I am able to highlight the column of the cell containing the WW value (e.g. in picture column I is highlighted as it contains "WW42" in cell I3. I would like to be able to highlight the days from Sunday to Saturday of each WW.
Most formulas (that I know) work on the value of the cells rather than their location or index. I have tried simply filling in all the blank cells with the WW value and then hiding the value, but the formatting isn't aesthetically pleasing and it's not efficient.
I have also tried merging the WW cells, but am unable to select all columns of the length of the merged cell, just the first column associated. For example, if I merged I3 to O3, conditional formatting will highlight that merged cell and only column I.
Any suggestions on how to approach this is greatly appreciated!
Attached is a screenshot of my structure with my conditional formating working as required. You'll need to adjust acording to your structure, but I used a formula-based conditional formating, with the rule:
=COUNTA($B$2:B$2)=$A$1 //Where A1 contains the workweek I want to highlight
Entered into cells $B$3:$V$6. Of course, in your case you'd have to change it to something like:
=COUNTA($B$2:B$2)+41-3=$A$1
Since your work weeks start at 42 and you have 3 extra headings you dont want added on your sum (ACTUAL START, ACTUAL DURATION and PERCENT COMPLETE). Also the header for the work week has to be a numeric value, but you can play around this to get what you need. Let me know if you'd need further help.
You do not need to use the third row for your conditional formatting, if row 4 has legal excel dates. The WEEKNUM() formula gives you exactly what you need.
If your Dropdown Menu is in cell B2 and consists of numbers from 1-52 then this should work for your conditional formatting:
=$B$2=WEEKNUM(D$1)
See attached photo.
I am trying to highlight cells that fall outside the expected value range (higher or lower only). Each row corresponds to a different row that has two cells with a max and min. Is there a way to make Excel figure that out?
For example Row 7's cells should only highlight if they value is outside the min of B31 or max B32. And Row 18 should be governed by Row 42.
I have used conditional formatting. But I want to apply the same logic to all the cells and rows instead of doing them one by one.
Scott Craner's suggestion is spot on. You can use a formula inside of your conditional formatting by following the instructions below:
Select Cell B4 (Sodium baseline test results)
Click "Conditional Formatting" in the Ribbon, "Highlight Cells Rules", and then "Less Than"
In the dialog that pops up, enter the following formula:
=VLOOKUP(A4,$A$27:$C$48,2,FALSE)
Click OK to save and apply the conditional format.
Click the B4 Cell again, and select the bottom right corner (you should see a little box sort of that you can click and drag).
RIGHT CLICK AND DRAG (not left click/drag) that bottom corner so that all the cells get selected. Then when the dialog box pops up, select "Fill Formatting Only". This will apply the formula to all the cells, and the lookup conditions automatically update based on the test name in the same row.
Repeat the above for the Greater Than rules, but modify the lookup formula as follows so that it looks up the MAX (3rd) Column:
=VLOOKUP(A4,$A$27:$C$48,3,FALSE)
If this answer was useful or helpful, please mark or indicate as such, thank you!
I have two Excel columns of numerical natural values and of the same length.
For each row I would like to fill the cells with red if the values are different, with green if they are equal.
I thought I could do this using Conditional Formatting but it seems it is not fit to compare two columns.
Am I wrong? How can I do that? How to use an IF statement for this?
Assuming the values are in column A and B
To create the first rule:
Select columns A an B. Do this by dragging from column header A to
B.
Then, click Home > Conditional Formatting > New Rule.
In the New Formatting Rule dialog box, click Use a formula to
determine which cells to format.
Under Format values where this formula is true, type the formula:
=$A1=$B1
Click Format.
Select a green fill color.
Click OK until the dialog boxes are closed.
The formatting is applied to column A and B.
Now you can create a second rule for =$A1<>$B1 with red fill color.
A "cheat" (if your columns are not too long) is to transpose your two columns, then use CF's Highlight Cells Duplicate Values rule (but change the default colours to suit) and transpose back again. It may be a slight advantage of this transposition that formatting will not be applied to cells in the same row that are both blank (though easy enough to arrange for this with a formula rule).
The point of my answering however is really to say that you only need one rule. Since every cell is going to be either red or green using standard formatting for one format is sufficient. For example, fill your entire data set with 'standard' green fill and then apply a formula rule for red. This will happily override the 'standard' green fill where appropriate.
If applied to Range $A:$B (such as by first selecting ColumnsA:B) I suggest a formula rule of:
=AND(A1<>"",$A1=$B1)
You do not need an IF statement because the formatting is conditional (the IF is implicit).
Assuming your data is in columns A and B, first select the column you want to colorize.
Then for the green :
Conditionnal Formatting > New Rule > Use Formula to determine... > type formula : =(A1=B2)
Then Click the Format... button and choose Green color
And for the red :
Conditionnal Formatting > New Rule > Use Formula to determine... > type formula : =(A1<>B2)
Then Click the Format... button and choose Red color