Conditional Formatting using dates and weekends - excel

I have data in a spreadsheet like this
Name | 9/1/2016 | 9/2/2016 | .... | 6/8/2017
Abe | | | |
Jonas | | | |
I want to highlight every column where the date is either a weekend or a user defined date (for instance, a holiday....does excel already know federal holidays?).
The conditional format I have is:
Applies to
=$b$2:$KI$62
Format values where the following formula is true
#1 =WEEKDAY($B$1:$KI$1,1)=1
#2 =WEEKDAY($B$1:$KI$1,1)=7
Yet nothing shows up. At the best I've been able to only make the bottom row show up through playing with the function. Why?

With Name in A1, select B2 to the extents of your data and use the following to create a conditional formatting rule.
=WORKDAY(B$1-1, 1, $L$2:$L$4)<>B$1

Related

Date-Formatting in TEXT formula independent from used language in Excel does not work anymore after update of Office365

With reference to this question I have been using the below solution to have a date-format in a TEXT formula independent from the language that is used in Excel:
Excel:
| A | B |
--|--------------|----------------|-
1 | 2021-11-01 | #BLOCKED! |
2 | | |
Formula in B1:
B1 = TEXT(A2,REPT(#Time_Global_Year,4)&"-"&REPT(#Time_Global_Month,2)&"-"&REPT(#Time_Global_Day,2))
Name Manager:
Time_Global_Year = INDEX(GET.WORKSPACE(37),19)
Time_Global_Month = INDEX(GET.WORKSPACE(37),20)
Time_Global_Day = INDEX(GET.WORKSPACE(37),21)
However, after Office365 version has been updated I am suddenly getting the error #BLOCKED! instead of a date in Cell B1.
Do you know what I need to change to make it work again?
As mentioned in the comments enabling Excel 4.0 macros solved the problem:

Alternate row colour by data in fields in a spreadsheet

Good Afternoon all,
I've had a search but can't find the answer - please direct me if there is one!
I'm looking to make my spreadsheet have better readability to the user. It requires a lot of manual work outside of the sheet, so the less time strain the spreadsheet is, the better.
I know to to use =mod() in Conditional Formatting but this isn't what I'm looking for
I also know about opening the filter drop down, and clicking one cell, pressing down twice and pressing space bar (rinse and repeat) - but I'm not going to do this over 1000 rows...
Is there a way to alternate the colours from a filtered name in excel?
For example:
+---------------+---------------+--------------+
| Site Code | Site Name | Changed Date |
+---------------+---------------+--------------+
| 000020 | Bobs site | 28/11/18 | <-- colour 1
| 000020 | Bobs site | 26/11/18 | <-- colour 1
| 059201 | Julian's | date | <-- colour 2
| 059201 | Julian's | date | <-- colour 2
| 002237 | etc. 1 | date | <-- colour 1
| 523878 | etc. 2 | date | <-- colour 2
| 523878 | etc. 3 | date | <-- colour 2
+---------------+---------------+--------------+
So rather than by line number, it would be by the name "bobs site" would be one colour, the next in the list would be another colour etc
I would love for this to apply to site code and site name, so when filtering by either, the rows are highlighted correctly.
I can't do this in the =mod() kind of way, as some sites have just one entry, most have 2 and a few can have up to 10
EDIT: Proof of the answer working for future references
Doable with a helper column and Conditional Formatting with COUNTIF and MOD.
In the helper column:
=OR(A2<>A1,B2<>B1)
which returns TRUE or FALSE if the site code or site name has changed (or not) compared to the previous row.
Then 2 conditional formatting rules:
=MOD(COUNTIF($D$2:$D2,TRUE),2)=0
=MOD(COUNTIF($D$2:$D2,TRUE),2)=1
The mixed reference ($D$2:$D2) in the COUNTIF will allow for each separate section to be coloured alternately as the instances of TRUE are successively added up.
One solution; get all uniq values in a seperate column, copy column you want to refer to, paste to new column, remove duplicates.
Then select area with data and start refering those values you want to have that color i conditional formatting.
Edit
With more options use "AND" or "OR"

Excel: Create new Row for each column

I have a data set as follows:
A | B | C |...
1abc | 1def | 1ghi |...
2abc | 2def | 2ghi |...
...
This is a collection of memo notes for each account in our database. The 1 in "1abc" represents the account ID and the letters represent some text. There are a total of 177 columns and 1866 rows but not every row has values up to column 177, some may only have two columns worth of data.
I need each column to drop down to the bottom of column A so that all data only occupies Column A. For example, all the data in column B would inserted after the last value in A. Data in column C would be inserted after the last value in column A after it's been populated with the data from B and so on.
In the end, it should look something like this (from which point I can simply sort it in ascending order).
A | B | C |
1abc | | |
2abc | | |
...
1def | | |
2def | | |
...
1ghi | | |
2ghi | | |
...
Can anyone help out with this? I am assuming that I need a macro and have tried working with the solution found in this post but couldn't figure it out. Oh, and I'm using Excel 2003 if that helps.
I am not sure if this will help but, from what you have given me, it sounds like you have 3 columns of data that you would like to be put into one column. If I am correct in my thinking, you can do this a few different ways. So as to preserve the original document in its entirety while adding an extended sorting system you could: 1: Create new tab. Then highlight range a with your mouse. Using your mouse right click and select copy (try to keep in mind the value of the range, E.g. How many items have you copied. Paste it in your now tab. Do this for the remaining ranges. Or maybe use V look up. If you would like I have a schedule module I have created that has many different types of range associations. You can also split sting in excel to divide the id from the sting.
Without VBA, add a blank row at the top and a column on the left populated throughout with say x and then follow the steps detailed here. Then delete the left-hand two columns and filter the remaining one to remove any blanks.

Automatically Show (Un-hide) Columns in Excel

Is there a method whereby columns in Excel (2003, 2007 and/or 2010) can be automatically shown (un-hidden) when the column to the left contains data?
Something like this:
IF column to the left contains data
THEN show column
+-----+-----+
| C | C | //If column1 contains data
| O | O | //Then reveal/show (unhide) column2
| L | L |
| U | U |
| M | M |
| N | N |
| 1 | 2 |
+-----+-----+
I'm guessing that VB code is required but am unsure as to what this would be.
Further to this, is there a way to automatically show the column going by the date (first day of each month)? This is a little more complicated. For example:
FOR all dates
IF system date = year(month.day1) //If it is the first day of a new month
THEN show column(month) //Then show the corresponding column for that month
ENDIF
ENDFOR
i.e. IF system date = 01/09/2012
THEN show column(September)
Is this possible?
Thank you.
Correct, you need VBA to achieve that. Use the Worksheet_Change event which fires whenever something changes. Then, use one of the various methods to determine if a column is not empty (http://ewbi.blogs.com/develops/2006/03/determine_if_a_.html, or just google). Alternatively, if this is to slow because if fires almost all the time, you could use the Worksheet_Activate() event (an overview of all Excel events can be found here).
If your column 7 contains data, you can unhide column 8 using MyWorksheet.Columns("8:8").Hidden = False.
Your second problem can be solved in a similar way. In the Worksheet_Activate(), check if today is the first day in a month using Day(Date) = 1 (I guess it needs to take into account that the user may not be using Excel this day, so the code should be a little more complex) and show that column using MyWorksheet.Columns("12:12").Hidden = False (or whichever it is) for December 1st.
All this code assumes that the columns are already there, just hidden.

Excel Conditional Formatting - Containing Multiple Matches

Trying to avoid VBA and use one Conditional Formatting rule.
I want to apply a format to cells that contain one or more possible phrases.
| A |
---+--------+---
1 | foo |
2 | bar |
3 | foobar |
4 | baz |
5 | foobaz |
6 | qux |
7 | barqux |
Goal: apply conditional format to 'foo' and 'baz' (rows 1,3,4,5)
Something like the following should work, however I think the problem is in identifying the current cell to compare, in this case the A1:A7 needs to be the current cell reference:
=OR( IFERROR(FIND("foo",A1:A7),0) > 0, IFERROR(FIND("baz",A1:A7),0) > 0 )
Any ideas?
I found the answer.
Even though the conditional format was being applied to the range $A$1:$A$7, all you need to do is refer to the first cell in the function.
=OR( IFERROR(FIND("foo",A1),0) > 0, IFERROR(FIND("baz",A1),0) > 0 )
It'll automatically increment so long as you don't use the lock operator ($). - Sorry if this is common knowledge. I'm going to keep this here for educational purpose, if no one has a problem.
You're perfectly right. You have to enter the reference to the "selected" cell. E.g. if you click into cell A1 and then drag and select cells A1..A7 you will see that A1 has different background than the other cells. This is your current cell for the conditional formula. I.e.
=OR( IFERROR(FIND("foo",A1),0) > 0, IFERROR(FIND("baz",A1),0) > 0 )
would be correct in this case. For the other cells the formula will then be adjusted accordingly.

Resources