excel conditional formatting help - excel

I have formatted the columns as follows:
_($* #,##0.00_);_($* (#,##0.00);_($* "-"??);(#_).
If I copy paste the value then it doesn't work.
But if I type 1234, then it automatically converts to $ 1,234.
But how can I make it work even I do pasting.
I googled it and found that conditional formatting is used in these scenario.(Am I right?)
I tried doing conditional formatting also but could not secceed.
Can somebody tell me how to achieve this in conditional formatting:
How to convert text so that final value will be like $ 1,234 ?
If the column is empty or white space , replace it with - in the center.
Any type of help is appreciated.
Thanks.

When you paste something into a cell in Excel, by default, the format is also pasted. To prevent this, you must do a Paste Special, then choose to only paste the Value.
For the conditional formatting of the currency, you can set up a rule that looks like this:
Getting a '-' to appear in a blank cell is not possible in Excel formatting rules. A dash can be inserted as formatting, but only as long as there is actual data in the cell. If the cell is blank, Excel will not display any characters.

If what appear to be numbers are imported as text there is likely to be a warning of this in Excel (a small green triangle in the top left of the cells - for all recent Excel versions can be turn on/off in Options, Formulas, Error Checking). By selecting a range that includes the first instance, these strings can be converted to General format (so that values are recognised as numbers) by clicking the warning icon and Convert to Number.
Then 'standard formatting' can be applied, perhaps:
` $* #,##0 ;($* #,##0)`
and empty cells selected with HOME > Editing - Find & Select, Go To Special..., Blanks then formatted Alignment Center and contents entered with Find (nothing) and filled with hyphens with Replace with -.

Related

Remove ' from cell, but keep cell content as text

I am looking to remove the ' before the content of a cell in order to do a VLookup, whowever when there are no letters it is turning the value into a number and the vlookup is retrieving inaccurate values. Any idea?
pre - '02364W105
post - 02364W105
pre - '151290889
post - 151290889 (this becomes 1.51E+08)
Change the cell format to Numbers and it does change the style. Normally it should work without it though.
You ha ve to select all these cells and change format to Number.
Probably they will still include the " ' " until you edit each one from the formula bar or pressing F2 and then ENTER.
The best way to avoid editing one by one is to write "1" into an empy cell, then copy it, then select all the cells you want to convert to number, then paste special, select "values" and "multiply".
This will convert all you cells with number formatted as text into numeric cells with numbers inside.

Bold Partial Text String in Excel w/o Formula

I using the CONCATENATE function to merge multiple columns with some text and carriage returns. The result is being pasted as values in the next column. The result will look like this:
Section 1-1
Y = -77.687
X = (-3.454,13.500)
I want the first line of the result to be bold. I dont want to use code as I'm not comfortable with it.
Can anyone please help find a way in which I can use a formula/ conditional formatting/ replace or other non-code options to make the text string bold AFTER PASTING IT AS VALUES.
PS: The operation needs to be carried out in approx 1000 cells and every time the first line will be "Section ..." ( the "1-1" part may/may not change)
Thanks in advance!
You could use Conditional Formatting to solve this. Simply set new rules for the column to format only cells beginning with "Section". You can see how I did it here. Then format the font that it becomes bold.
If it's not concatenated, write the cell as normal with no formatting. Then F2 to reenter the cell, highlight the word you want to bold (or otherwise format; underline, color, etc.) apply ^B (Click Bold in ribbon) or whatever other formatting you need.

Excel Conditional Formatting and dragging to neighbouring cells

I have a condition set up =IF(C2<42,C4="") the background color will turn red if met.
When dragging the crosshair (at the bottom left of the cell) to neighbouring cells, the formula stays the same.
I need the formula to then change to =IF(D2<42,D4="") and so on 300+ times, Is there any way to refer to the current column i.e =IF(thiscolumn-row2 < 42, thiscolum-row4 = "")
Excel sometimes by default puts dollar signs in front of the cell/row labels
(ie $C$4 instead of C4 .... the dollar signs tell excel not to change the formula with each row but to lock in the original values. Does your rule in conditional formatting show dollar signs? That may be your problem. Get rid of the dollar signs and what you need should work.
You don't use If in Conditional Formatting formulas. The formula itself defines the condition that you are looking for, so the if is already implied. So your formula should simply be something like:
=C2<42
I'm confused about the 2nd part of your formula, C4="". Is that supposed to be a 2nd condition? If so, use an AND statement:
=AND(C2<42,C4="")
If you are using Excel 2007 or 2010 another source of potential confusion is that references don't change in the Conditional Formatting formula box when you drag them around, even if they are relative.
Assuming you want to apply formatting to the range c1:d300, select that range of cells, bring up the conditional formatting box and enter:
=AND(C2<42,C4="")
Now it will apply the formatting with relative references to the full selected range.

Force Excel 2007 to treat all values in a column as text

I have a large column of data in Excel. This data should all be treated as text, but in some cells Excel is "magically" changing the data to numeric. This is screwing up my vlookpup() functions in another part of the spreadsheet, and I need to override Excel's automatic data type detection.
If I manually go through the cells, and append ' to each numeric cell, it works. I just don't want to do this by hand for several thousand cells.
For example, this works:
Manually type '209
And this does not work:
Manually type 209, right click and format as text.
If changing the format of the column is not an option, it's helpful sometimes to create another column that's 'vlookup friendly' and leave your main column alone.
This is a trick I've used a few times:
Say your 'mixed' column is column A.
In column B, enter the formula:
=CONCATENATE(A1)
or as Jean-François pointed out in a comment, the shorter version:
=A1 & ""
And drag it down for to the bottom row.
Column B will be all strings. The VLookup can then use column B.
Under the Data Tab, open the Text to Columns wizard and set the Column data format to Text. The destination cell can be set to the original data cell, but it will replace the original formatting with text formatting. Other aspects of formatting e.g. Bold, color, font, etc. are not changed using this method.
Setting the cells to "Text" format, as Jean mentioned, should work. The easiest way to do this, in any version of Excel, is:
Right-click cell, "Format Cells", "Number" tab, select "Text" format.
Have you tried setting the cells' number format to "Text"?
In Excel 2003: Format > Cells... > Number > Category: Text.
I don't have the more recent Excel versions, but it has to be something similar.
I tried all the above but didn't work. And then added an apostrophe before the number. Only then it changed to text from the exponential notation.
If you already have your data and manually adding a quote in front of your data in each cell is not an option you can use a helper column and write
="'"&A1
in B1, where A1 is the reference to your cell, and drag down the formula in B1 to the bottom. At this point you will see the quote, and you need to paste data in column B as values (CTRL+C & ALT+E+S and select values, or paste special as values from the top menu). Then find+replace a '(quote) with a '(quote) and you will have a column with values forced to text and a quote in front of each numeral representation of the number.
Updated for Office 365 / Excel 365:
CONCATENATE is being deprecated and replaced by CONCAT.
This method still works, i.e. I need 7E10 to appear as 7E10 and not 7.00E+10
Microsoft documentation source here.

How do I prevent values being shown as # in excel

I have a cell which is formatted as Text field with wrap text on. The values are shown as "#" when I move away from the cell, how do I prevent it?
Try to expand the column size (width). If this doesn't help try to format the cell as General instead of Text.
When this happens to me I just have to expand the column size so that the content fits perfectly within the cell.
More about it here:
Excel - #### sign in cell formatted "Wrap Text"

Resources