Cells Defaulting to Original Formula if Blank - excel

Hello and thank you for taking the time to read (and answer) my question.
I'm trying to create a data spreadsheet where one of the functions is to populate a series of columns with dates (added days, ie. 15 days, 7 days, etc.) based on the originally entered date (let's call that Date A, with the series of dates as Date B, Date C, etc.). Each following date down the series is added from its predecessor, so Date B is 14 days from Date A, Date C is 7 days from Date B, and so forth. Pretty easy stuff by simply using =A1+XX where XX is the number of days, etc.
The dilemma:
Each of the dates must have the capability to be manually overridden, with the dates in the series to reflect that change. In other words, if there's a 15 day count between Date B and C, and Date B was manually overridden from 1/1/2014 in and changed to 1/15/2014, then Date C should also change from 1/15/2014 to 1/30/2014
If a user was to change his mind and delete the manually entered date, it should revert back to using the original formula to acquire a date. Another words, if the user was to simply delete the data from the cell, ie. the cell is blank, the original formula should now be back in place to acquire data.
I'd also like to highlight any of the dates generated by a formula to be bold-italicized and a different color as well (ie. blue)
I managed to get the color change and the formulas all layed out, but I'm not sure how I can bring back the formula if manual data is entered and then deleted. I assume an IF ELSE can do this via VBA, but not sure how.
Can anyone help? Thank you in advance!

One way to do this without using VBA is this.
You can put one cell (I am calling this "manual override cell" or MOC) next to the cell where the formula is placed (formula cell or FC). If the user wants to input, he can input in the MOC. The FC then would contain an isblank function which checks if the MOC contains any value. If there is a value, that value overrides the output of FC. If the MOC is blank, then the formula overrides.
Something like =if(isblank(MOC),(FC-1)+xx,MOC) where (FC -1) is the previous value of FC in the series.
Does this work?

Related

Excel IF + AND + Date range formula

I am looking to create and IF function that does the following.
There is a ton of data with one column containing dates. I want and if functions that labels each row according to the following.
If date falls between 0-30 days of todays date in the past then label "GOOD" (so if todays date is 21/09/2017 then it should be labelled as "GOOD" should it falls between the dates 21/09/2017 and 21/08/2017)
If date falls between 31-60 days of todays date in the past then label "FAIR"
If date falls between 61-90 days of todays date in the past then label "ATTENTION"
If date falls between 91+ days of todays date in the past then label "CLEARANCE"
Hope someone can help.
Many thanks
Use
=IF(TODAY()-A2<31,"Good",IF(TODAY()-A2<61,"Fair",IF(TODAY()-A2<91,"Attention","Clearance")))
Column D shows the difference between today date and cell date.
Alternative Answer
Use VLOOKUP to potentially ease your future formula maintenance. In an unused location, set up a table that has your break point ranges and associated return values. For this example I used the following:
Technically speaking column G is not required, but it can be easier for some people to read.
Now assuming your dates are in Column A, you can use the following formula in B2 copying down:
=TODAY()-A2
and in C2 use the following look up formula and copy down to get your desired results:
=VLOOKUP(B2,$F$3:$H$6,3,1)
now if you are not keen on generating the extra column for calculate the number of days, you can substitute that first formula into the second to get:
=VLOOKUP(TODAY()-A2,$F$3:$H$6,3,1)
place the above in B2 instead and copy down.
The following is an example of the first approach:
The main advantage to this approach is you can manipulate the lookup table easily changing breakpoints, wording of results etc easily without touching your formula (when done right)
if you have the potential for negative days, instead of returning an error, you could wrap the lookup formula in an IFERROR function to give a custom message or result.
=IFERROR(VLOOKUP(B2,$F$3:$H$6,3,1),"In the Future")
Assuming your data starts with A2, A3 and so on.. as below
Apply the below formula in B2 and drag down up to A8
=IF(AND(--TEXT(TODAY()-A2,"##")>=-1,--TEXT(TODAY()-A2,"#")<30),"GOOD",IF(AND(--TEXT(TODAY()-A2,"##")>=30,--TEXT(TODAY()-A2,"#")<60),"FAIR",IF(AND(--TEXT(TODAY()-A2,"##")>=60,--TEXT(TODAY()-A2,"#")<90),"ATTENTION",IF(--TEXT(TODAY()-A2,"##")>90,"CLEARANCE","FUTURE DATES"))))

Conditional formatting rule based on multiple criteria and today's date

I have a large client list with multiple columns. Columns of interest:
column E - file status/needs,
column H - next appointment date.
I need a formula to change the formatting of the row if column E reads "executed" or "signed" only if column H also reads a date prior to today's date.
For example today is aug 11, 2016, joe schmoes file is "signed" (column E) and the next appointment date is "aug 9, 2016" (a past date in column H).
I need the row to be highlighted so we can see that this file needs attention.
I have tried many different formulas and I am not getting anything to work exactly correct. The closest formulas I have are below:
=IF(AND(TODAY()-$H1>=0,TODAY()-$H1<=15),SEARCH($E1="signed",$E1="executed"))
The problem is if the cell in column E reads" signed" like I need it to the formatting doesn't apply - formatting only applies when column E returns a false value and the words signed or executed are not in that row's E cell.
I know the first part is also not absolutely correct as it is only searching for a value in column H between today and 15 days past. (I couldn't figure out how to write the formula to be ANY past date).
Another one I've tried that has worked is:
=IF(AND(TODAY()-$H1>=90,TODAY()-$H1<=365),SEARCH($E1="signed",$E1="executed"))
Obviously this is only for values in column H between 90 and 365 days past today but I'm having the same thing where the formatting doesn't apply if column E reads either of the two searches entered.
I have also thought of doing negative rules, basically write a rule that any past date in column H that has a word other than "signed" or "Executed" in column E will return a certain format but haven't tried any formulas for this yet.
If the formula you have is totally different than what I have but accomplishes the goal that is fine I just need this to work and I'm spending a ton of time using the research, trial and error method.
Select your entire sheet and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=AND(IFERROR(SEARCH("executed",$E1)>0,SEARCH("signed",$E1)>0),$H1<TODAY())
Format..., select colour Fill (highlight) of your choice, OK, OK.
This assumes (amongst other things!):
executed and signed may be only part of a cell's content, might
occur together and should trigger CF regardless of case.
if the next appointment date is actually today, no fill.
the dates are not text format.
your version of Excel has IFERROR.
=AND handles the requirement that different columns are involved in the trigger.
Individually these are covered by a long element and, for the short element, the =TODAY function where the less than (<) operator if for where the date value in Column H is any date less than the current date, or no date value at all.
The longer element is a pair of =SEARCH functions, one each for executed and signed so that either (or both) will contribute to the CF trigger. Since the data may not be required to be case sensitive SEARCH was preferred to =FIND.
SEARCH returns the index of the position at which the search term is found and an error if not found. Since for these purposes where in the cell does not matter, any numeric result would serve and >0 covers all those possibilities. =IFERROR was used to trap an error arising from the absence of executed to allow searching to proceed for signed in that situation (otherwise the overall result of the formula would be an error and the CF not be triggered).

Excel: Return Multiple Items with One Lookup Value but on a different sheet

My formula works, but only if its in the same page, and along the same rows
Formula:
=(INDEX($C$1:$D$4,SMALL(IF($C$1:$C$4=$F$2,ROW($C$1:$C$4)),COLUMNS(D1:D4)),2))
Note: Column G has the formula, what it does it look for value in F2 (which is 1.2) within the columns of C & D, and extracts the respective data in column D. So in this case, it would extract the data in column G.
Question: Now what do I do if I want this to occur from different sheets, or even different workbooks? I need to do this exact same thing, extract the data that is in column c and d (which is on a different workbook) to my workbook.
Every time I try, I get a value error.
Bonus: I'm also trying to get the date that is closest to today's date, I have this formula here:
=IF(COUNT(G2:G5)>0,INDEX(G2:G5,MATCH(MIN(ABS(G2:G5-$D10)),ABS(G2:G5-$D10),0)),"")
Where D10 is just equal to =TODAY() and this entire formula works by pressing ctrl+shift+enter
If you can also include this into the formula so that it just spits out the closest date in G2 rather than spit out all the dates. But it is not necessary, just helps a lot.
For your "Closest to today problem", I was trying to spread the difference of the date or a comparison of the date just like in your example. This is just not working out. I solved the problem by adding another column. I do not know if this is a valid option for you or not, but here is what I have. Assuming H is available or you can insert a new column H. use this dragged down for each row - in your exampl 2 thorugh 5.
=ABS(D$10-G2)
Then add this in H10 or wherever you see fit
=D10-(MIN(H2:H5))
Here is an excel-ish example
5/12/2014 =ABS(D$10-G2)
5/13/2015 =ABS(D$10-G3)
5/14/2014 =ABS(D$10-G4)
5/15/2014 =ABS(D$10-G5)
6/6/2016 =D10-(MIN(H2:H5))

How To Ignore Blank Cells for a Formula

I'm tracking hours for my company and I need to see the updated hours daily. I have everything formatted how I want it, except I want two columns to show how many hours over and under each employees current hours are.
What I have right now is
=(D3-C3)+(F3-E3)+(H3-G3)+(J3-I3)+(L3-K3)+(N3-M3)+(P3-O3)
But it is including all the empty cells (for days that haven't been worked yet) as a zero.
I want a formula that can allow me to ignore those blank cells until they have content.
I can't just use a SUMIF >0 function because I need to count the number of hours employees have MISSED (i.e. scheduled 12 hrs, actually worked 0).
Here's an alternate approach to #Tom's, though it works on similar principles. This one, however, relies on your ability to add a couple of 'HELPER' rows, above your current data.
I'm assuming that row 1 will alternate between saying "PROJECTED", and "ACTUAL".
I'm assuming that row 2 will be dates for that week, in Date format. So A2 will be Jan 1 2015, B2 will be Feb 1 2015, C3 will be Feb 1 2015, or however often the time blocks go up. The key here is that the PROJECTED columns and the ACTUAL columns will each need the date in them.
The formula to check the variance between that row's PROJECTED amount and that row's ACTUAL amount, only for dates prior to today, is (for row 3 and copied down, and assuming the data goes to column Z):
=SUMIFS(A3:Z3,$A$1:$Z$1,"PROJECTED",$A$2:$Z$2,"<"&TODAY())-SUMIFS(A3:Z3,$A$1:$Z$1,"ACTUAL",$A$2:$Z$2,"<"&TODAY())
This checks to see the value of PROJECTED columns for that row, where the date is less than today, and subtracts the value of ACTUAL columns for that row, where the date is less than today.
If you are looking to compare with something other than TODAY(), you can set up a cell to be your 'comparison point'. Manual type the breakoff period you are concerned with into that cell, and replace "&TODAY()" with, say, "&AA1" [assuming your breakoff point is entered in cell AA1].
As it stands, either a very long series of IF's and OR's or an array formula:-
=SUM(IF(OR(D3="",C3=""),0,D3-C3),IF(OR(F3="",E3=""),0,F3-E3),IF(OR(H3="",G3=""),0,H3-G3),IF(OR(J3="",I3=""),0,J3-I3),IF(OR(L3="",K3=""),0,L3-K3),IF(OR(N3="",M3=""),0,N3-M3),IF(OR(P3="",O3=""),0,P3-O3))
=SUM(D3:P3*ISEVEN(COLUMN(D3:P3))*(C3:O3<>""))-SUM(C3:O3*ISODD(COLUMN((C3:O3))*(D3:P3<>"")))
The second one must be entered with CtrlShiftEnter
Note that it could easily be broken by insertion/deletion of columns.

How to show a value in one cell when current week is in another cell in excel

My first time to this forum.
I am a free range poultry farmer and I am trying to make spreadsheets to monitor my flocks. I have made the flock specific input sheets and now working on getting information for all of them into one summary sheet.
My question is...
I have the age of the birds going down column A also I have dates by week end date going down Column B... I would like to know how to have it that in one summary cell when the current date falls into one of the weeks listed in Column B that the corresponding cell in Column A is shown in that Summary cell (showing the current age of the flock). I would like this obviously auto update when the date progresses into another week.
Can any one help??
Thanks
Put the current date in the header (=TODAY() function or variations).
Name the current date cell (e.g. Current_date)
If your data are in table format I recommend putting them in a Table, this will insert your formulae to any new row started. If you dislike them you can simply create filters.
Use the formula in say C5 "=B5=Current_date" This will give you a logical expression, TRUE or FALSE. You can filter for TRUE to see the flocks to sell/cut.

Resources