IF Function Using Cells Formatted As Time Hh:mm
Mar 28, 2014
I am trying to calculate the difference in time between two cells and if the difference is >= 8 Hours the result is 8 hours - 1 Hour if the result is less than 8 hours then the result stands. I have the following, but it returns 8 always.
The two cells are formatted as hh:mm
H6 = 06:30 & G6 = 14:30
=IF(((H6-G6)>=8),"((H6-G6)-1)","(H6-G6))")
View 3 Replies
ADVERTISEMENT
Nov 13, 2009
I am trying to build an if statement to test variables that are in time format and then perform a calculation.
I was able to get an example working if I convert the start times to integers rather than time values. However, the data won't be provided to me as integers.
So, I need a nested if statement (using "and") that will test for two situations using cells in time format or I need to write a macro to convert the time data to integer format. I've been working on the former most of the day and have hit a brick wall.
View 3 Replies
View Related
Aug 11, 2006
I'm trying to lookup data in a cell formatted as time, the array is also formatted as time but I continue to get the #N/A. Is there a certain format that I should use?
View 9 Replies
View Related
Mar 14, 2009
I've written a script to read all the values in an excel worksheet in to an array. The cell types differ from General or Text to Custom - HH:MM When I look through the array the script has returned the correct value for most but for the cells that are of a custom type an "incorrect" value has been returned. For example a cell of type Custom HH:MM which is 10:23:00 in the worksheet appears as 0.432638888888889 in the array. Is there a way to get the script to return the correct value?
Below is an extract of the code I've used
If objWorksheet.Cells(i, "D") <> "" Then
If objWorksheet.Cells(i, "F") <> "" Then
arrCULDEV = Split(objWorksheet.Cells(i, "F"), ":")
Redim Preserve arrSheetInfo(x)
arrSheetInfo(x) = arrCULDEV(0) & "," & arrCULDEV(1)
x = x + 1
i = i + 1
Else
i = i + 1
End If
End If
View 2 Replies
View Related
Aug 11, 2006
I'm trying to lookup data in a cell formatted as time, the array is also formatted as time but I continue to get the #N/A. Is there a certain format that I should use
View 6 Replies
View Related
Mar 19, 2008
I am trying to get a single cell to display the following:
Last Updated: 3/18/2008 15:08 (GMT+2)
Entering =NOW() in a cell displays the date and time as required.
But entering ="Last Updated: "&NOW()&" (GMT+2)" displays the date and time as a serial number. Formatting the cell to Date does not change the serial number to date and time format.
The only way I have found to get the desired result is to use =NOW() in another cell (F13), format that cell to general to get the date/time serial number, then use ="Last Updated: "&TEXT(F13,"m/d/yyyy h:mm ")&" (GMT+2)" in the required destination cell.
As I said this works, but it strikes me as an inefficient method. Is there a formula I can enter or formatting I can apply to get the desired result without using an addition cell?
The result needs to be in a single cell. Splitting text and date/time into 3 adjacent cells will not work with my worksheet setup.
View 9 Replies
View Related
Aug 4, 2009
I need to calculate the difference in Years, Months and Days between:
Date 1 = TODAY()
Date 2 = 4 years after a date in cell A1, which will always be earlier than today's date
(A bit of backround - I have certain risk management procedures that have a lifespan of 4 years. I want to calculate the time between now and 4 years after the date the procedure was completed, essentially to see how long before they have to be redone).
So far I have:
=DATEDIF(A1+4,TODAY(),"y")&"y "&DATEDIF(A1,TODAY(),"ym")&"m "&DATEDIF(A1,TODAY(),"md")&"d"
But that returns #NUM!.
Removing the +4 obviously just calculated the difference between the date in A1 and today, but I need the date in A1 PLUS 4 years and today.
I have also tried:
=(DATE(YEAR(A1)+4,MONTH(A1),DAY(A1))-TODAY())/365.25
which works in theory, however:
a) no consideration for leap years
b) does not return nY, nM, nD - only the decimal.
However I would be happy to use this method if I could convert it to Years Months Days.
View 11 Replies
View Related
May 1, 2014
I am trying to use the vlookup function but the range of reference has that little green triangle in the corner and if I f2 each cell that triangle goes away and the vlookup function works great. Do you know what is going on here? And also, a quick way to convert all the cells with the green triangle to be without the triangle in a whole range? I don't want to have to go to each cell individually and f2. I've attached an example worksheet for reference to what I am describing. vlookup format.xlsx
View 2 Replies
View Related
Dec 8, 2012
Is there an excel formula to count the formatted cells for each row?
Here an example;
Sheet2
A
B
C
D
E
F
G
H
I
J
K
1
EXAMPLE
COUNT
2
01 05 31 34
10 18 21 28
23 26 33 36
06 11 37 39
15 19 25 30
16 17 35 38
02 03 08 09
04 12 27 29
13 14 24 40
07 20 22 32
3
[Code] .........
View 4 Replies
View Related
Feb 1, 2014
Just wondering if it possible to sum cells that have been highlighted in yellow in an excel spreadsheet? I currently use Office 2007 and 2010.
View 4 Replies
View Related
Apr 18, 2007
I am trying to write some code that will loop through the workbook (selecting all cells formatted as currency), updating the cell value and rounding to 2 decimal places. The updated price must be rounded as these prices are used in calculations.
The prices are not in a contiguous range and are in different cells on each sheet, but all within the range (“B1:V200”)
I need the user to enter the required increase I,e 1.05 (5%) in Price update sheet, cell “F6”, then run the code from this sheet (which will be the only sheet I do not want to run the code on, which will be the active Sheet)
This is the code I have so far
I don’t know if it will work yet as it errors out (Type mismatch) on this line.
cell = cell.Value * Sheets("PriceUpdate").Range("F6").Value
Sub UpdatePrices2()
For Each Ws In ThisWorkbook.Worksheets
If Ws.Name ActiveSheet.Name Then
For Each cell In Ws.Range("B1:V200")
If cell.NumberFormat = "$#,##0.00" Then
cell = cell.Value * Sheets("PriceUpdate").Range("F6").Value
cell = WorksheetFunction.Round(cell, 2)
End If
Next cell
End If
Next Ws
End Sub
View 9 Replies
View Related
Aug 25, 2008
I'm trying to use the SUMCOLOR function found on your website to sum cells which have conditional formatting (background colors with bold writing) applied to them, but it doesn't work.
I'm attaching the code found on the website as a reference.
I read some content on Cpearson but it's way beyond my understanding.
Function SumColor(rColor As Range, rSumRange As Range)
''''''''''''''''''''''''''''''''''''''
'Written by Ozgrid Business Applications
'www.ozgrid.com
'Sums cells based on a specified fill color.
'''''''''''''''''''''''''''''''''''''''
Dim rCell As Range
Dim iCol As Integer
Dim vResult
iCol = rColor.Interior.ColorIndex
View 9 Replies
View Related
Mar 5, 2007
I currently have a spreadsheet that i am using to track invoice pages when I receive them. I have added a conditional format on the worksheet that turns the Date red when each invoice is due and i manually shade each cell grey when the invoice is received, however as i have many invoices due on the spreadsheet its a bit dificult to track all of them... i have been told that a VB code will help. (I am new to this)...
I want to put a Command button on the spreadsheet that will take me to the next cell that has the text highlighted as red and the background color is white i.e not shaded.
View 9 Replies
View Related
May 1, 2014
I am looking to produce a Macro to select conditionally formatted cell's from a worksheet, i got as far as selecting those cell's but i need it to only select cells that have been filled.
View 6 Replies
View Related
Aug 18, 2009
I have a series of conditionally formatted cells which turn the text in them to red if the value is less than 40. This works fine.
Occasionally however a value of less than 40 will need to be entered along with the letter 'v'.
ie. 39v
I'd still like this to be coloured red, but it's obviously coming out as black.
Is there a way to sort this out?
edited to add : Im actually using a separate cell to enter the value 40 (as the value can change).
View 7 Replies
View Related
Oct 17, 2013
I'm working with a big dataset and the dates come out in this way:
94WAO7t.png
EDIT: Example of book included
View 10 Replies
View Related
Feb 17, 2014
How do I write a bar chart which reads the format of a cell instead of the content? ie I want to count how many cells in each column are amber. Amber cells have already been decided by conditional formatting.
See demo attached : bar chart demo.xlsx‎
View 6 Replies
View Related
Jan 20, 2012
How to count those that are formatted in RED or bold using Excel 2003 as I know in later versions that is possible but old ones I am unsure how to count them.
View 1 Replies
View Related
Jun 9, 2014
I am pretty new to VBA and have been wrecking my brain and reading just about every Thread there is on this and still can't figure out why I am not getting the code to work.
I am trying to get data from Column "Sale Price", stored in Table "MasterInventory" on worksheet "Master Inventory" to populate a textbox in a UserForm by means of Vlookup.
Upon running the code below I'm getting Value Error 1004, and during Debug when I hover over "MasterInventory" it shows "MasterInventory=Empty"
Also Im trying to figure out how to do it so I can call the "userform" up from any worksheet and add the entries in the table on worksheet (Jan, Feb, Mar, etc.) for the month depicted in the TextBox "Date" on the Userform
The code looks like this:
Private Sub CBx_PROD_AfterUpdate()
'lookup value in Col F [Sale Price] based on Product (Col A [Description] in Table [MasterInventory])
With TB_SP
If OB_Y.Value = True Then
Me.TB_SP.Value = Application.WorksheetFunction.VLookup(CBx_PROD.Value, MasterInventory, 6, False).Value
End If
If CBx_PROD.Value = "" Then
Exit Sub
End If
End With
End Sub
View 6 Replies
View Related
Jun 10, 2014
I know the VBA code to count cells from a data set that were manually colour-coded.
The problem is that the code (pasted below) doesn't seem to pick up cells that were coloured via Conditional Formatting. How do I do this? What is the VBA (if there is one)?
Function COLORCOUNT(varRange As Range, varColor As Range)
Dim cell As Range
For Each cell In varRange
If cell.Interior.ColorIndex = varColor.Interior.ColorIndex Then
COLORCOUNT = COLORCOUNT + 1
End If
Next
End Function
View 1 Replies
View Related
Aug 5, 2014
spread sheet that I need to do for work. Unfortunately I do not have excel on my home computer to be able to attach a spread sheet
The spreadsheet has one column (A) with a list of questions. The column next to this (B) has either a red or yellow cell in each row (a red cell would be a high risk to the business if the answer to the question in that row was no, and a yellow cell indicates a moderate risk to the business in the answer to the question in the row was no).
The third column (C) is conditionally formatted so if a 'y' was placed in any of the cells they would turn green. If 'n' is placed in any of the cells the cell would change to either red or yellow (this would depend on what the colour was in column B).
I need to know a formula to count cells by colour. So the number of red, yellow and green cells in column C would be counted automatically into a totals box for each colour at the bottom of the spreadsheet. I have tried some online suggestions but couldn't get these to work for cells that had been conditionally formatted. I'm not the most experienced person with spreadsheets (this time last week I couldn't add two cells together)
The final thing I need from the spreadsheet (and I'm not even sure if this is possible) is for a total box to be colour co-ordinated based on the number of red, yellow and green cells in column C. I would need the total box to be green if all column c is green, yellow if three or less cells in column C are yellow and red if any of the cells in column C are red or there are more than 3 yellow cells in column C.
View 2 Replies
View Related
Jan 3, 2008
Is there any way of writing a macro so that specific cells are formatted to start with a capital letter and end with a full stop. Can you also write a macro to automatically spell check specific cells?
View 11 Replies
View Related
Apr 1, 2014
Say I have a worksheet that has a column in which every cell is formated in hh:mm:ss format. The column is probably 100 cells long...so from A2 to A101 (A1 is the title of the column). Now, we need to take the data in cells A2:A101 and graph it, but the data needs to be formatted in only seconds. So, in column B, we want to convert the data from column A into seconds format.
For example,
cell A2: 00:01:46
cell B2: 106
Of course, we can't convert each cell by hand, because this needs to be done on a lot of data...worksheets upon worksheets.
View 5 Replies
View Related
Nov 14, 2012
Is it possible to keep ending zeros in cells that are formatted for Text or General?
I have a column with numbers like the following: 264400
I need to format this number for three decimals so it will look like the following: 264.400
I need the column to be formatted for either Text or General. Currency breaks a system.
View 1 Replies
View Related
Mar 28, 2014
I am looking for a function to convert time given by my computer (Local time) in EST (Eastern Standard Time). We are several users of a same file (with timestamp macros) and all time need to be aligned to one time zone (EST), even if all users are working in different time zone (EST, CST and IST).
View 1 Replies
View Related
Sep 8, 2009
I need a sum function in A1 of a "Total"-sheet that totals cell A1 in every sheet with a certain color on the tab. The number of sheets can vary from time to time.
Any idea about a dynamic sum function that will do this, in combination with VBA?
View 2 Replies
View Related
Nov 17, 2005
I am using the count function for attendance tracking of Vacation, Personal Time, & Sick Time. (Example: = COUNTIF($F6:$CQ6, "V")
I need to be able to do half days. I have tried many different formulas/ways to incorporate the half day scenario even without using the count function with no success.
View 13 Replies
View Related
Nov 19, 2008
I am looking for a formula to change a condition based on the time of day. Essentially, before 1pm I would like the formula to be:
=((I12/100)*25)/D12
After 1pm I would like the formula to be
=((I12/100)*25)/B12
I tried various ways with "=if(now()> ..." formulas to no avail because of the way Excel handles Now().
View 6 Replies
View Related
Jan 25, 2009
D: is quantity to be made
G: is number of minutes this will take
J: is the time each order should be finished
Problem
at 12:00 work stops for lunch and resumes again at 12:30
Somehow I need this to be reflected J:
View 4 Replies
View Related
May 30, 2014
I have a spreadsheet where i do need to count cells values that are formatted as text but i do need to ignore the real text in some cells, in this formula i do need to add values depending of the adjacent cell.
I have attached a example : New Microsoft Excel Worksheet.xlsx‎
View 8 Replies
View Related