need hyphen instead of zero in my excel formula - excel

I want to add some values in my excel sheet , but when there is no value want hyphen instead of zero .
Here is my formula as below :
=IFERROR(SUMIF(A1:A6,"="&VLOOKUP($F$3,A1:B6,1,FALSE),B1:B6),"-")

The formula for that'd be:
=IFERROR(IF(SUMIF(A1:A6,"="&VLOOKUP($F$3,A1:B6,1,FALSE),B1:B6)=0,"-",SUMIF(A1:A6,"="&VLOOKUP($F$3,A1:B6,1,FALSE),B1:B6)),"-")
But I suspect you just want to change the number format to ACCOUNTING... it automatically replaces zeros with hyphens.

Related

How to bring in string from left of numbers in Excel

I'm trying to format a column based off of another (let's say column B2). The column contains a value like "ABC011" and I need to bring in just the letters "ABC".
For another column I also need to bring in just the numbers "011" but without the trailing zeroes (although I imagine that if I can get the solution for the first question I'll be able to figure out the second).
Thanks in advance.
EDIT: The length of the characters can change but the numbers are USUALLY 2 or more digits as well as the letters.
To isolate the first characters from the numbers, in C2 this array formula:
=MID(B2,1,MIN(IF(ISNUMBER(SEARCH({0,1,2,3,4,5,6,7,8,9},B2)),SEARCH({0,1,2,3,4,5,6,7,8,9},B2)))-1)
Being an array formula it must be confirmed with Ctrl-Shift-Enter when leaving edit mode. If done correctly then Excel will put {} around the formula.
If you have excel 2010 or later you can use this non CSE Formula instead of the one above. It does not require the Ctrl-Shift-Enter:
=MID(B2,1,AGGREGATE(15,6,SEARCH({0,1,2,3,4,5,6,7,8,9},B2),1)-1)
Then using that result in D2 we put:
=RIGHT(B2,LEN(B2)-LEN(C2))
This will put it in as a string, if yo want to make it a number just put -- in front:
=--RIGHT(B2,LEN(B2)-LEN(C2))
This will return the number as a number so 011 will become 11
To get the numbers

Number value as text

I have a single cell with the value:
426,427,433,439,442
This isn't a number, rather a list of numbers. If I try to add another number to the list, for example, 679. Excel changes the cell to read:
679,426,427,433,439,000
If I select the cell and format it as "text", it changes to:
4.26427E+14
I've tried various cell formatting options, but I can't seem to get Excel to treat these numbers like text.
Copy and paste the column into Notepad, format a new column in Excel as text. In Notepad select all, copy it back out from Notepad into the column in Excel that you formatted for text.
First place a single quote (apostrophe) in front of the set of numbers and add the latest value at the end appropriate position.
add (apostrophe) in front of numbers
add (comma's) between
add any number by adding a (comma)
Possibly:
=LEFT(A1,3)&","&MID(A1,4,3)&","&MID(A1,7,3)&","&MID(A1,10,3)&","&MID(A1,13,3)
It seems you have a number 426427433439442 with the commas purely a presentational aspect of the formatting. I take it you want the commas and the only way now may be to insert them.

Concatenate numbers separated by dash while keeping leading zeros

I have two columns in Excel with leading zeros that I want to concatenate. The below code works perfectly. It concatenates the columns and retains the leading zeros from each column:
= A2&B2
However, I need a dash between the values. When I alter the formula to the following the leading zeros to the right of the dash are removed:
= A2&-B2
How do I add that dash while retaining all leading zeros?
Use Excel's CONCATENATE formula.
=CONCATENATE(A2,"-",B2)
Here, I use 00df9 in cell A2 and 00asd in cell B2 with a result of 00df9-00asd
if I've used two separate formulas using concatenate into one cell and both or one brings answer with decimals, how can I format to limit or remove (roundoff) the result numbers?
Here's the formula:
=CONCATENATE((F2/4.2),"/",((F2/4.2)/7))
and here's the example result: 273.809523809524/39.1156462585034
Now, for me, the idea solution is that the cell shows 234/39. Basically how (if at all) can I format that cell with concatenate formula?

Modifying a Column of Excel related to phones

I have a column of phone numbers
e.g
344-444022-22
234325343
(545)3454-3454
These are some formats
I want to convert all the phone numbers to simple 345354 format no dashes or brackets and also i ant to add USA Code "1" in front of all numbers
How can i do that in excel?
Assuming A1 is the reference where the phone number is you could use the following formula in a cell to remove the characters '(' '-' and ')'
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"(",""),")",""),"-","")
Copying this formula for all of the phone numbers should work if these are the only characters that are used in the different formats.
EDIT
If there is another character that you would like to remove, lets assume ' ', you can simply surround this formula with another SUBSTITUTE function, which works like the following:
SUBSTITUTE(source_text,text_to_replace,replace_with_this)
Making the formula:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"(",""),")",""),"-","")," ","")
You could use a formula:
=1&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"-",""),")",""),"(","")
There is probably a more concise way to do this. But his should work.

How to remove the first letter in each cell in a column in excel?

I have column in excel like below,
'04-Feb-01
'04-Mar-01
'08-Apr-01
'06-May-01
'03-Jun-01
'08-Jul-01
'05-Aug-01
I want to remove the character ' in all cells how can i do that?
I already tried with =RIGHT(A1,LEN(A1)-1) this one.. not working
Convert the text to a date using DATEVALUE. Then apply a date format to your liking.
When you enter data into a cell, Excel will try and convert it to the correct type (is it text, a number or a date) The single quote is Excel's way of saying treat what follows as text. It comes in handy when entering things like telephone numbers which Excel might think is a number and would not display leading zeros. In your the example the actual value in the cell is the text without the single quote, you can check this by copying a cell and then pasting into notepad and there would be no quote in the result.
Why do you want to remove the quote? If it is because you want the cells to contain a date rather than text you can convert it using the DATEVALUE function or by using copy and paste special values only .

Resources