If Function Decimal
Feb 26, 2009
I need to create a formula in a spreadsheet so that when KWD or BHD is entered into a cell then another cell changes to 8 decimal places if neither of these are in the box then it needs to be 7 decimals! But the box that is changing needs to be alterable.
I have posted this on a non excel specialised forums and i got this answer:
in cell x you have "kwd"
in cell y you put: =IF(cell X="kwd",TEXT(cell Z,"#,##0.00000000"),TEXT(CELL z,"#,##0.0000000"))
in cell Z you put the value that you want to be alterable
View 14 Replies
ADVERTISEMENT
Feb 11, 2013
I am using this formula to output data into a cell:
=MID(A1,4,2)
The cell value is 50. I am wanting it to appear as 5.0 instead. Can I do this by adding to the formula above or will I need to utilize another cell to accomplish this?
View 2 Replies
View Related
Mar 27, 2007
I'm trying to do is to convert an hours per week field as a decimal into hh:mm as text. For example, 22.8 would convert to 22:48.
Public Function DecToHours(Ldecimal1 As Long)
Dim Ldecimal2 As Long
Dim Shours As String
Ldecimal1 = ActiveCell - Round(ActiveCell, 0)
Ldecimal2 = (ActiveCell - Ldecimal1) * 60
Shours = Round(ActiveCell, 0) & ":" & Ldecimal2
End Function
View 5 Replies
View Related
Mar 13, 2014
I'm on Excel 2010 and I need to round up a complete price list to a 0.90 decimal.
Here is the formula that I have in my cell : =((J5-(J5*N$2))*M5) I need to round the result to XXX.90
View 4 Replies
View Related
Dec 27, 2011
I need a function to find the number of decimal places of a certain number (in this specific case doubles)
The first solution would be something like this:
Code:
'returns the number of decimal places within a double
Public Function getDecPlaces(inputNum As Double) As Long
Dim ndx As Long
ndx = InStr(1, inputNum, ".")
If ndx > 0 Then
getDecPlaces = Len$(CStr(inputNum)) - ndx
End If
End Function
But i feel there is likely a much better way of doing this..
View 9 Replies
View Related
Sep 13, 2013
I have a workbook that is being used by users with both "," and "." as decimal separator. This is working all fine, except for one cell, where I need the number output to be displayed with two decimals. See formula below:
="Open at " & TEXT(+OHL!J$13+OHL!H$15,"0.00") & " and Go"
This example does not work with "," decimal settings.
Is there any different way to force two decimals in a text string, except for TEXT (where the format given in itself limits the cross decimal separator functionality)?
View 3 Replies
View Related
Dec 4, 2007
I have created a userdefined function. the Idea is for the user to calculate the difference in hours and minutes. The input would be like budtime = 30 , realtime = 1.25 the answer I would like to have is 28:45 (28hours and 45 mins). Im aware that I can format the cell manually with [h]:mm but I'd like the function to do it.
I have written this:
Function RT(BudTime, RealTime)
RT = Format(((CDec(BudTime) - CDec(RealTime) / 24)), "[h]:mm")
End Function
View 5 Replies
View Related
Feb 17, 2010
Any function in Excel, that would allow me to have a unit cost price (for example: 0.5432) and then for a table of figures containing the pack sizes to determine the correct unit price that would allow all pack costs to be at 2 decimal places. I have included an example below:
My spreadsheet would look like the following:
Cell A1 (Unit Cost Price) = .5814
Cell A3 (Pack of 75 units) = .5814*75 = 43.605
Cell A4 (Pack of 80 units) = .5814*80 = 46.512
Cell A5 (Pack of 100 units) = .5814*100 = 58.14
and so on
I need some way of making cell A1 change to a value that will cause all cells A3 to A5 to be 2 decimal places or less.
View 3 Replies
View Related
Aug 13, 2009
I have a vba macro that takes data from one workbook and pastes it into another workbook. In doing this I have declared a few variables of type single (I only need two decimal precision). However, when I copy the values from the cells on the source workbook and paste them into the target workbook, the numbers end up having 12 decimal places. Ultimately, this extra precision causes my totals to be off by .01 or more after a while. I have tried rounding the number as I pull it off the source workbook into the variable, but that didn't matter. How do I solve this problem? Code for pulling data from source workbook:...
View 2 Replies
View Related
Aug 3, 2006
Basically, I want to format a group of cells to display 1 decimal figure if the number is not a whole number. If the number is a whole number (or if the rounded first decimal place is 0) I want it to display no decimal.
View 9 Replies
View Related
Jun 10, 2009
I need to convert a column of numbers currently formatted with 2 decimal places e.g. 112.12 to 4 decimal places (without the decimal point). I need the end result to be 1121200. I've tried a few different suggestions given on the forum previously but can't seem to retain the 4 decimal places that I require.
View 4 Replies
View Related
Apr 15, 2012
I have to make a excel document in which I have length and width in feet and inch format.
E.g. 10.01 in which 10 is feet and .01 is inch
I have all the length and width values in the above format. And what I want to do is convert the inch value (10.01) to feet value (.01=.08 feet) .
Just like the calculator here does.. [URL] ........
Like
10.01=10.08
10.02=10.16
10..03=10.25
...and so on...
Here is table of conversions from inches to decimal feet. But I don't know how to get a formula for this in excel...????
Inch Decimal of a Foot
1 inch 0.0833
2 inches 0.167
3 inches 0.250
4 inches 0.333
5 inches 0.417
6 inches 0.500
7 inches 0.583
8 inches 0.667
9 inches 0.750
10 inches 0.833
11 inches 0.917
12 inches 1.000
View 7 Replies
View Related
Aug 8, 2008
I am trying to create a unique sample code by putting together the values of other cells that a user will input. It's all working well apart from the last part, where I am trying to include a decimal number. I want the decimal number to appear without the central "." and in a four digit format. e.g. 2.5 would appear as 0250, 14.25 would appear as 1425. This is the formlua I am using currently:
=IF(ISBLANK(B4),"",IF(LEFT(C4,1)="w",(B4&"-"&TEXT(F4,"YYMMDD")&C4&TEXT(G4,"HHMM")),(B4&"-"&TEXT(F4,"YYMMDD")&C4&LEFT(TEXT(H4,"00"),2)&RIGHT(TEXT(H4,"00"),2))))
However, where the value of H4 is 2.5, I am getting a result of 0303 (I've put this part in bold). I have attached a small spreadsheet to aid understanding.
View 2 Replies
View Related
Jun 10, 2007
I need a formula to multiply only the decimal number in a cell and not the integer. For example: the number in the cell is 57.3615. I want to multiply .3615 only.
View 2 Replies
View Related
Feb 27, 2014
I need a formula to take a number with several decimal places and round it up to two decimal places to either .33, .66 or, .00 if its above .66.
For example, 4.23423423423423 will be 4.33
4.43453453533434 will be 4.66
4.8353453453 will be 5.00
Lets say the number is in cell A1. What formula would do this?
View 3 Replies
View Related
Aug 22, 2014
i try to convert several decimal values into Days Hours:Minutes:Seconds my problem is the following. If i user the format DD hh:mm:ss values over 32 will start counting the days from 0 (like a new month). and if i format it like M D h:m:s values < 32 days gets displayed with a 1 (for the month) before the days.
[Code] ......
is there a way to get only the count of days displayed without the summarization to months?
View 4 Replies
View Related
Sep 8, 2009
Extract 2 digits to the right of a decimal when it ends in 0, AND keep it a value.
Ex: .69 .75 .50 .70 = 69 75 50 70.
Text to columns won't work because it has to calculate from other cells' data. This value is then used in an IF function.
View 6 Replies
View Related
Apr 30, 2013
I actually have time entered as a number and decimal.
10.29 means 10 minutes and 29 seconds. How can I get that to only seconds 629?
View 3 Replies
View Related
Jun 23, 2014
I want to truncate the decimals like below: i.e.
2.22939393 -> 2.229
2.22977777 -> 2.229
3.33477 --> 3.334
1.062578 --->1.062
[Code] .....
View 5 Replies
View Related
Aug 5, 2013
I was going to use the following to test that a number has no more than two decimal places,
Code:
If Int(ActiveCell.Offset(0, 8) * 100) ActiveCell.Offset(0, 8) * 100 Then
However it is rather mysteringly failing when activecell = 16.99 or 17.99; on testing it appears that vba is evaluating Int(ActiveCell.Offset(0, 8) * 100) to equal 1698 or 1798
View 1 Replies
View Related
Oct 27, 2007
Does anyone know how to convert a 4 digit number to binary in excel? I used the =DEC2BIN formula, but it only works on a 3 digit number that is smaller than 512.
View 9 Replies
View Related
Apr 25, 2008
I have excelsheet with the following data
A - 1.3
B - 1.3
SUM: 2.6
Now when I want get sum of A and B it shoud be 2
i.e. Round figure of
A - 1
B - 1
SUM : 2
Whereas I'm getting sum as 3 instead of 2 as round figure of 2.6 is 3
View 9 Replies
View Related
Jul 23, 2008
I would like to enter whole numbers but have them convert to decimal. I have searched and found a solution, but it only references to one column and I need to reference other columns as well. I tried to edit but I’m not very knowledgeable with code. Here is an example of what I am looking for, columns E31:E52, F31:F52, L31:L52, M31:M52, N31:N52. Could someone provide a code to acquire these results?
View 9 Replies
View Related
May 31, 2006
I'm trying to find out how many 40 hour shifts we had in a week by dividing the total seconds staffed (2989957) by total seconds in a week (144000) to get a 2 digit decimal result. I have a field formatted as [s] that I need to convert to decimal but when I do a calculation using that field it comes out as [s}.
Cell A1: 2989957 formatted as [s]
Cell B2: =A1/144000 formatted as number with 2 decimals
Result shows 0.00
If I use that calculation in a cell with a general format, I get 21 and it reverts to [s] format.
View 2 Replies
View Related
Apr 2, 2014
I'm looking for a formula to break number in to decimal . Which means for 5 digits i.e 12555 to 12.5 and 4 digits i.e 1555 to 1.5
View 4 Replies
View Related
Nov 9, 2005
How to find the difference between two time stamps giving the result as a time decimal. I.E. 16:45 - 12:00 = 4.75 hrs
View 4 Replies
View Related
Dec 14, 2008
Is there a way to delete only numbers ending in a decimal from a column of numbers? I have a column of numbers but only the non decimals are relevant to the next equation.
View 3 Replies
View Related
Feb 21, 2009
Cell C9: 1.25773
Cell C10: 20.0
Cell C11: 2.25%
Cell C15: =C9+((C10*C11)/10000)
C9 is a user entered value, currently formated general
C10 is a user entered value, currently formated decimal with one decimal
C11 is a user entered percentage, currently formated percent with two decimals
C15 is a formula calculation, currently formated general
I've tried formating cells to general (and/or) text and the values appear to be correct but still don't show what I want.
The most popular entries for C9 will be:
123.12
123.123
1.1234
1.12345
Any of the above could have one or more trailing zeros.
I would like C15 to show the same amount of decimal places that the user enters in C9. If user enters one, two, three, four, five, etc...decimal places in C9 then show the same amount of decimal places in C15 after the calculation is done and include any trailing 0's that are needed to match the number of decimals in C9.
I've tried different If statements with custom format to try to get the format of C9 transfered to C15 but haven't come across the right way to do this.
View 14 Replies
View Related
Jun 8, 2009
I'm trying to make a shift schedule template, and it's all done except that i cant sum the hours the way I think i should be able to.
I've attached the file for reference.
I've added in some hours for myself as an example. I have 47.5 hours in the week. I've got 3 Rows, In Out and Hours. I've formatted the In and Out the way i want them, but I would like the Hours row formatted as a decimal, so that 7 hours 30 minutes would show up as 7.5.
I'm also having trouble with the totals column at the end. Although D8:J8 total 47.5 hours, it's adding them as 23:30.
View 6 Replies
View Related
Jun 24, 2009
I need to convert the fraction at the beginning of a cells text into the decimal equivelent. for example 1/4-20 3A would give .2500. I have this formula so far that works perfect for fractions that only contain 1 number on each side of the division sign such as 1/2.
View 2 Replies
View Related