Formatting Keyboard Commands (negatives In Red With Parenthesis)
Dec 15, 2009
I use keyboard commands whenever possible. They are much quicker than the mouse.
For years I have been using [Ctrl]+[Shift]+[1] to format cells as numeric with two decimal places, 1000 separator(,) and showing negative numbers in black with a minus sign in front.
I have a column with both positive and negative numbers, is there a macro or a bit of code that will convert all negative numbers in a selected column to zeroes?
I'm trying (with little success) to match some negatives and positives, but the formulas that I found on line keep on picking up all matches (just like a VLOOKUP formula)
23 23 -23
The formula would match the -23 with the 2 positive 23s. This formula goes in Column O
I have a question regarding calculating percentage differences, here is how our formula works, but I've done a little research regarding using negative number for percentage calculations and am not sure...
For sample:
this year (TY) we had net profit of $200 million last year (LY) we had net loss of -$32 million
our formula works kinda like this:
=IF(B49="","-",IF(B49=0,0,D49/B49-1))
but if, the comparing numbers is negative should I convert that to an absolute number using ABS ? what if both numbers are negative ?
The way I understand the current formula is like this:
if B49 is blank, then insert a dash, otherwise IF B49 is 0, then 0 (since we can't divide by 0), otherwise do the formula.
Long Version: This should be a fairly simple question, with a solution involving unchecking a box somewhere, but I can't find it. Whenever I enter a number in parentheses (for example: "(187.13)") into a cell Excel automatically converts that number to a negative--- "(187.13)" becomes "-187.13". I've been using the apostrophe option as a workaround (i.e., '(187.13)) to store it as text instead of a number, but this is becoming a hassle because it recognizes that (187.13) is a number and alerts me with an error message of numbers being stored as text.
Short Version: Basically, I want it to stop automatically making "(187.13)" become "-187.13" but I don't know where the setting is.
For year 2007,2008,2012 and 2013, we have negative cash.
I want to compute for the investment cost, which I define to be the total accumulated cost before first positive cash. First positive cash occurs at 2009, so I want to sum 2007 and 2008, However, 2012 and 2013 also reports negative cash, so in the SUM formula, their values will be included.
How should I write the formula in order to sum all the negative cash before positive cash, disregarding all the other cash flows thereafter (be it positive or negative)?
I have the following code in a user form, attached to a data field that the user should fill. This code should alert the user if he enters a negative number i.s.o. a positive (and vise versa). Due language related issues, it is quite possible that the user will enter (by mistake) a negative sign but it will be at the end (500-) and the user will not notice this mistake. For some reason, my code does not pick up on this, and does not pop up the error message. Therefore, I decided that I need to check if the value entered by the user also contains a “-“ at the end of the string. This, I believe, will take care of the problem.
In excel, I would simply enter a formula with Mid and Len (to check if the last character is “-“) , but I don’t know how to implement it in my code.
Sub txt_sum_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) 'Verify that a negative sign was added for expenses With Me.txt_sum Select Case cbo_act Case "Expense", If Me.txt_sum.Value > 0 Then MsgBox "Number must be negative" End If Case "Income" If Me.txt_sum.Value < 0 Then MsgBox "Number must be positive" End If End Select End With End Sub
i'm looking for a formula that gives the greatest number of a range problem is that there are positive and negative numbers in the range but I only want to look at the value (+/- signs are not important)
look at my attachment and see what I am doing wrong in my formula? I have a hard time understanding the Sumproduct formula and when to use comma's, double negatives, addition, etc.
This is my formula and it returns: -55 bps. =[ASK.xls]QTR!$AT$81&" "&"bps"
However, I want it to return (55 bps). I don't want to just add the parenthesis because in the future this formula could return a positive number. I tried to format the cell differently, but that did not work.
I have a formula which I've been working on which utilizes a lot of defined names and INDIRECT functions. I have been parsing out the segments of the formula to figure out which section is incorrect, and I think it is from the last SUMPRODUCT on. I think I have a parenthesis issue.
Right now, I am using an index match to find a name. It returns it correctly, but is there something I can add to formula to to return the name, and put the name in parenthesis. Example: currently it returns name Chile, but I want (Chile).
I'm trying to separate text that have commas in between. I've got a column that contains commas and a few cells in those columns have commas and bracket. The problem occurs when there are more than two values WITHIN in the bracket that are separated by commas. How can parse the text in such a way where what ever is within the bracket remains in tact? For example: Controls, Motors, Transformers (LVoltage, High Performance, Medium Voltage). The goal is to separate everything before a comma but for Transformers I would like it to remain as 'Transformers (LVoltage, High Performance, Medium Voltage)'.
"your formula is missing --) or (. Check the formula and then add the parenthesis in the appropriate place. The following is one long string. I broke it up to make it easier to read.
i have a worksheet with imported data. it is a chess game notation with comments. is it possible to separate the comments from the moves? the comment part comes in parenthesis. whatever comes in paranthesis has to be separated to the next column. I have given an attachment in which on sheet 1 , is the raw data. on sheet2 i have shown the result.the sheet has to be so edited that it should look nice.since i have separated the comments manually it does'nt look nice.I have separated the comments from the first table of contents only.
i usually don't use the buttons. instead i go for searching the code in the macro dialog. did this time also. but i could not find it there in the list of codes. i even changed the word"private" to option explicit with no positive result. what should i really do to run the macro? i always want that macro is named in the dialog when i click on othe macro-code groups.t
I am importing into Excel a list of contacts from a txt file so I can make a mailing label database. I am able to seperate out the various parts of the address just fine but here's where it gets tricky.
Below is a example of the text I am importing: Mr Dow Jones, 600 DIXON ROAD, TORONTO, ON M9W 1J1, CANADA (1-416-6757611)
I need Excel to look at the cell containing the country name and: 1st. see if there is a phone number present (this is the numbers between the () and if there is - place the phone number in Cell F1 and place the Country in Cell E1 but strip out both the () and the phone number. If there is no phone number present (and therefore no () I need Excel to go ahead and place the country name in E1
I have a spreadsheet with 900 rows. All of the rows hold different information. The first column has contents such as this:
This is the text (please remove me) This is some more text (I need to be removed too)
I want to remove from every cell, everything in the brackets - so everything from the first open brackets to the end of the cell contents). Every cell is a different length and the information within the brackets is different.
For a spreadsheet that contains info with opening and closing parentheses in the cells I'm testing on, I am having problems getting multiple IF statements to work together in the same formula. I can get them to work separately in different cells, but when I try to combine them in the same cell, I get the #VALUE error. Here is what I'm working with:
In cell G7 I have the text: Fort Fraser (1) In cell H7 I have the formula: =IF((RIGHT(G7,1)=")")*AND(MID(G7,LEN(G7)-2,1)="("),LEFT(G7,LEN(G7)-4),G7)
In cell G8 I have the text: Fort St. James (11) In cell H8 I have the forumla: =IF((RIGHT(G8,1)=")")*AND(MID(G8,LEN(G8)-3,1)="("),LEFT(G8,LEN(G8)-5),G8)
Both formulas work correctly by discarding the parentheses and everything in between, as well as the space before the opening parenthesis. As you can see, the first formula will work with a single digit in the parentheses, and the second works with two digits. It's just when I try to combine the two tests in the same formula (editing the second one so it also tests on G7) that I get the #VALUE error. I have tried using OR to combine the two tests.
I am importing data into excel from another application. I place the data on a sheet and then use macros to re-arrage the data to another sheet. One column of cells gets populated with strings of the following format <text1>(<text2>) I would like to extract <text2> and place it in a cell on another sheet. the length of text1 and text2 varies.
I'm trying to enclose a variable declared as string with a numeric value within parentheses. here's the code I have...
Dim strQuery As String, strPortIP As String strQuery = Application.InputBox(Prompt:="Please enter the port or IP you want:", Title:="Query Input", Type:=2) strPortIP = Application.InputBox(Prompt:="Is this a port or IP?",Title:= "Query Type", Type:=2)
If strPortIP = "Port" Or "port" Then strQuery = "(" & strQuery & ")"
I'm getting run-time error '13': type mismatch on the "If..." statement. I'm trying to set the variable strQuery to "(80)", for example, to do a Find within my data. Without the "()" I get ALL occurrences of "80" and that's not what I need...