Selectively Formatting Small Dollar Amounts with Cents - excel-formula

In reporting revenue figures for various accounts, most dollar amounts exceed tens of thousands of dollars per week. However, a few accounts occasionally report values
To expand the cents, I found this formatting condition: [>=1]#,##0;[<1]
However, I lose the "accounting" formatting (dollar sign).
How can I modify this formatting condition to reflect "$" accounting?
(In other words, I need a formatting condition that displays both a dollar sign and cents for values

Just add custom format Type: [<1].00¢;$0.00_¢ and for showing both at the same time Type: [<1].00¢;$0.00¢
The result:
https://docs.google.com/spreadsheets/d/1nMMEkX3ufeHh7UGhcg8SYMpygKDHcJrUvQAMW7wYqTk/edit?usp=sharing

Related

Excel won't wort mixed dates

I downloaded a file from a government source. There is a column of dates in mixed formats. Some appeared 12-25-99 while others were 25-Dec-99 and some were 12/25/99. I want to sort them newest to oldest. There are over 600,000 records but I tried everything on a sample of about 25 to save time.
I managed by brute force to get them all looking the same: 12/25/99. There is nothing I can do to get them to sort. Some of the list sort because they were all the same format to start with, generally 12-25-99 though it might have been 25-12-99. No matter. The ones that had slashes never integrated with the ones that started out with dashes.
I found 6 or 7 ideas on this site but none of them worked. Help if you think you can.
Thanks.
The data samples you list suggest that what you perceive as "dates" is at least partly text. Excel internally stores dates as numbers, with day values before and time values after the decimal point (or decimal comma, depending on your regional settings). These numbers can now be formatted to appear as dates.
To check which of the "dates" are really dates, select them all and change the format to "General". Any real dates will now show as numbers, whereas any "dates" that are really just text, will remain unchanged.
In order to sort this data chronologically, you will need to convert the text values to real dates.
There are several different approaches you could use for that. You could use a formula like DateValue() - this works well with text that has the date and month in the same order as your regional settings. So, if you use US settings with MDY order of a date, give that a try.
Otherwise, and especially if the original dates are a mix of DMY and MDY order, you will need to use more sophisticated data cleanup techniques, like Text To Columns or Power Query.

robust date and time formatting for calculations

I'm trying to format date and time data as it comes to me from a database to use for calculations.
Sample of data:
The instrument that the data is pulled from has operators enter sample dates and times by hand, and the software doesn't allow for special characters so everything is delimited by "."'s and " "'s. If you pair that with inconsistencies with number of characters (i.e. 0's before month, day, or hour), and use of AM and PM, it leads me to have to re-enter everything by hand for calculation purposes because things get so inconsistent.
The data flow is becoming heavier so the manual correction is becoming inefficient. Is there a robust set of equations I can use to format these entries and make them useful?
I know I can use the SUBSTITUTE function to get rid of the "."'s and " "'s, and if I can get the dates into a string of numbers
i.e 06.8.18 7.28 PM -> 0608181928
I could use a combination of the DATE, TIME, MOD, and TRUNC function to generate my dates and times. However, the inconsistency of number of characters and the need to correct for AM and PM is what throws me off.
Data with sample equations:
If your time may have seconds, a forth . then this will do any number of .:
=SUBSTITUTE(LEFT(A2,FIND(" ",A2)-1),".","/")+SUBSTITUTE(MID(A2,FIND(" ",A2)+1,99),".",":")
Then apply the format desired:
You can use a nested SUBSTITUTE to replace the 3rd period with a colon, then replace the remaining periods with slashes in an outer SUBSTITUTE. Then apply a custom format as needed.
=--SUBSTITUTE(SUBSTITUTE(A1,".",":",3),".","/")

Controlling Excel time format input/output

Background: I have been officiating our local jogging events for about ten years now. I am responsible for handling the data of the participants (name, sporting club, bib number) split into their categories (age bracket+gender, distance). The main task is collecting their times, and processing that data (sorting the runners within their category etc). I can handle this with Excel mostly fine.
Problem: What is the ideal time format for entering the race times of the participants? The times are either in the format mm:ss or (for slower runners and/or longer distances) h:mm:ss. Excel doesn't seem to have a built-in format where the hours field is optional. For optimizing my workflow ideally I would like to have a cell format such that the input
47:12 is to be interpreted as 47 minutes and 12 seconds, and the input 1:09:38 is to be interpreted as 1hr 9 minutes and 38 seconds. However, Excel, with the best fitting cell format that I found, will insist that the input 47:12 means 47 hours and 12 minutes. For times exceeding 1 hour I would input 1:03:00 if I meant that the seconds field is to be left with value zero.
How to make Excel realize that when the format can handle up to three numbers as inputs, it would, when given only two numbers, move them towards the end?
Thinking: I "can" key in 47 minutes and 12 seconds as 0:47:12 all right. But because most of the times are under 1 hour, that is partly wasted effort. Also, using such a format the data is displayed on the screen together with that superfluous 0:. What's worse (IIRC) those leading zeros
also appear in the printed versions, which is strange (insulting even) in a shorter distance for junior participants.
My hack: I enter the times as general numbers in the mm,ss format (in these parts a comma serves as a decimal separator). Excel can sort those as numbers just fine. I then duplicate the data of that sorted column to another "printable" version (formatted as text), where the data is just copied, but I correct the times exceeding 60 minutes by hand. This works just fine as long as I'm not in a hurry (our event is not exactly Boston Marathon, say, less than 200 participants), and remember to hide the column that is not supposed to be printed. This is kludgy, and there have been accidents, when other officials have been rushing me to get the results printed.
I managed to create a format where the hour-field is optional. It works with a conditional format. First you format your cells as standard, so you get the times as comma-values. After that you create a conditional format for these cells, which has two rules:
if cellvalue > 0.04166667 format hh:mm:ss
if cellvalue < 0.04166666 format mm:ss
Result:
47:12
01:09:38
01:00:00
So you get what you really want and you can use the original values for sorting and so on.
EDIT:
For the input you need four additional columns. You enter the times as you want, e.g. 47:12 and 1:09:38. In the next three columns you split these values in hour, minute and second, whereby the interpretation limit is 3 hours (03:00), which is 0.125.
So, these are the formulas for the split columns (your input is in B1):
Hours: =IF(B1>0.125,0,HOUR(B1))
Minutes: =IF(B1>0.125,INT(B1)*24+HOUR(B1),MINUTE(B1))
Seconds: =IF(B1>0.125,MINUTE(B1),SECOND(B1))
And finally, you put all values togehter in the forth column:
=TIME(C1,D1,E1)
and use the conditional format above.
If you will be entering your data as
`mmm,ss`
where the comma is the decimal point, then you can convert it to "Excel Time" with the simple formula:
=DOLLARDE(A1,60)/1440
Format the result as you wish.
If you want everything displayed as h:mm:ss then use that as your custom format (Format > Cells > Number > Custom Type:...)
If you want h to be displayed only with values of 60 minutes or greater, then use
[<0.0416666666666667]mm:ss;h:mm:ss
for your cell's custom format.
Beware that seconds must be entered with two digits always. In other words
6,2 will translate to 6 min 20 sec.
6,02 will translate to 6 min 2 sec
I really like IQV's answer above, but as pointed out in the comment section, the leading zero will be required for the data entry side. If for whatever reason this is not acceptable you can use the following ugly formula to convert your time entered in your usual method of mm,ss to hh:mm:ss with the hh: being displayed as required. Unfortunately it converts the whole thing to text which means you can no longer perform math operations on it.
=IF(FIND(".",MOD(D2,60)&".")=2,"0","")&MOD(D2,60)
and since you use , as your decimal separator the formula would become:
IF(FIND(",",MOD(D2,60)&",")=2,"0","")&MOD(D2,60)
If you use ; as your list separator then your formula becomes
IF(FIND(",";MOD(D2;60)&",")=2;"0";"")&MOD(D2;60)
There are probably some cleaner formulas, but that will get you started. Just replace D2 with the location where your time is stored.
Again I still prefer IQV's answer as you can do much more with the time information when its stored as a number and not text.
Option 2
lets say you change your data storage method to hhmm,ss in cell D6. you could rip apart the information and reassemble it in a display friendly version as follows.
=IF(FIND(".",D6)<=3,LEFT(D6,2)&":"&RIGHT(D6,LEN(D6)-FIND(".",D6)),LEFT(D6,FIND(".",D6)-3)&":"&MID(D6,FIND(".",D6)-2,2)&":"&RIGHT(D6,LEN(D6)-FIND(".",D6)))
you will need to substitute your list separator for the , and then substitute a coma for the decimal.

Hundred separator in Libre office calc number formating / Indian number formatting

I am moving to Open office spreadsheets and I need to handle large financial values in spread sheet cell.
By default libre office provide NUMBER & CURRENCY format, where "," is used as per Indian Numbering system(refer https://en.wikipedia.org/wiki/Indian_numbering_system )
However, I don't need the number till one's unit place. I need to see number in crore.
26,75,73,350 should be shown as 25.76
Libre office only provide "," as thousand separator. This separator follow US counting system, i.e. millons etc. If used as user-defined format "0.00,,"
I see cell value as 267.57 and not 26.76
What is a good user-defined format following Indian counting system?
I am not sure but try this, N4 contains the value 12345678
=ROUNDUP(N4/("1" &REPT(0,LEN(N4)-2)),2)
Result 12.35
You can changethe bold section with a fixed value 10000 or so
With a formula it would just be a matter of dividing by 10000000 (ten million) and showing decimal places to suit. Unfortunately Open Office Calc (like most other popular spreadsheet programs) does not provide such a format by default. However in a custom format , effectively divides by 1000 (one thousand) and % multiplies by 100 (one hundred) so 267573350 with a User-defined format of:
0.00,,,%
looks like 26.76%. The underlying value is however retained, so for example adding 1 to such a cell (in a different cell of general format) would show 267573351.
That is about as close as I can get just with formatting, but since % (ab)used this way is so open to confusion you might want to give some visual warning by say appending "C" to the format (0.00,,,%"C") to show:
26.76%C

Days Count using formula

Someone helped me pull the number of days of this string:
2015-04-01 14:31:00 -- 2015-04-15 14:02:27
Using this formula
=IFERROR((((DATEVALUE((MID('Paste Sales Report'!P3,FIND("-- ",'Paste Sales Report'!P3)+3,10)))-DATEVALUE(LEFT('Paste Sales Report'!P3,10)))*24)+TIMEVALUE(RIGHT('Paste Sales Report'!P3,9))-TIMEVALUE(MID('Paste Sales Report'!P3,FIND(" ",'Paste Sales Report'!P3)+1,9)))/24,"0")
anyone is able to help with the slightly more complex (the quotes are part of the string):
"Sales Report - agg-all-store - 86271 - 2015-02-20 09:45:40 - 2015-04-22 09:45:50”
Again I need to turn the data range in the string into a number of days.
Try this formula
=LEFT(RIGHT('Paste Sales Report'!P3,20),19)-LEFT(RIGHT('Paste Sales Report'!P3,42),19)
That will give you a decimal number of days, 61.0001157 for your example, is that how you are displaying it or do you want to show days, hours, minutes?
That works if you have the date/time stamps consistently at the end of the string (apart from the final quote).
You don't really need to split time and date as per your original formula, you can subtract one whole time/date entity from the other to get a result in days. That's what this formula does.
Note: in the original formula find looks for a double hyphen but I only see single ones in your example. If that's a double hyphen between the time stamps then change 42 in formula to 43

Resources