In JupyterLab, given the following code cell, how may it be split into multiple cells?
Likewise, given the following cells, how may they be combined into a single cell?
JupyterLab: splitCell
Source
In order to split one cell into many cells:
Place cursors where the split is desired, and then press and release ctrl + shift + -
Multiple cursors may be placed, by holding ctrl, and clicking the location for the cursor.
JupyterLab: mergeCells
Source
In order to merge multiple cells, into one cell:
Select the desired, consecutive cells, by holding shift, and clicking in the margin, where the [ ] is, which will highlight the selected cells.
While still holding shift, press m, and then release both keys.
The resulting merged cell, will have a space between the code from each cell, as does the first image in this answer.
This is the expected behavior newModel.value.text = toMerge.join('\n\n');
For those that come here for Jupyter in VSCode, you can merge cells by:
Selecting the cells (using shift + arrow is supported)
Right click > Join With Previous Cell (or Join With Next Cell)
Join With Previous Cell key: Shift+Alt+Windows+J
Join With Next Cell key: Alt+Windows+J
Note that it will join the selected range + previous or next cell. So, if you just want to merge two cell, no need to select using shift + arrow.
Related
Since I think I'm not expressing myself clear, I added some images:
As title reads,
I have a formula in a range C2 in Sheet1 something like this =IF(a2=2,2,""), and this is a recurrent formula from C2 to C21.
Sometimes the result is 2, but sometimes the result is "" which leaves an empty cell.
The problem is when i copy that range of cells and paste it as values in E2, it counts the empty cells, (the ones which result was "" in previous column) as if they were filled with some characters or something.
As you see in image above it counts 20, instead of only 5.
I tried to copy the range of empty cells and paste it into different text editors to see if i can find an odd character or something but no, they look only like enters.
Is there a way I can copy cells that contains a formula with "empty/nothing" results, and paste them as values and as empty cells for excel not to take them into account to perform the counting, they are also being taken into account in pivot tables.
Is there a special character that I could replace, like for example when i want to remove all carriage returns in a range of cells, i use the replace function in Ctrl+H and then in find what: ctrl+j and in replace with: (i leave it empty), and this removes all carriage returns included in cells, leaving all comments in a single line.
I usually have to go thru all the columns with same situation of fake empty cells, and delete them manually after i filter them (they are even displayed as blanks when filtering them).
Even if I use the Find & Select - Special - Blanks, it wont select the fake empty cells.
I look all around the google globe and wasn't able to find an answer.
I hope you guys can understand what i explained above and can help me.
Thanks in advance for your appreciated support.
Regards
The pasted cells are not really blank - if you turn on "Transition Navigation Keys" in File > Options > Advanced under the subheading Lotus Compatibility and you'll see there is an apostrophe in each of the "empty" cells.
What you've done is inserting a zero-length string into each of the cells which doesn't fulfil your if-criteria. These strings are then copied to the range you are pasting to.
To remove them quickly, there are a couple of options.
Using find and replace:
Select all the cells Press Ctrl + H to open the Find and Replace
window
Leave the Find What box empty
In the Replace With box,type a string that is not in the data, such as "$$$$"
Click the Replace All button, to Replace all the blanks with $$$$
Next, put "$$$$" in the Find What box and leave the Replace With box empty
Click the Replace All button, to replace all the $$$$ entries with nothing
Using text to columns
Select all the cells
On the Excel Ribbon, click the Data tab and selcect Text to Columns
In the dialog which pops up, select Delimited, then click the Finish button
I found all this info on the Contextures blog, which goes into some more detail about the problem, as well as presenting a couple more ways to solve it.
I've got an excel worksheet that contains as cell values stuff like this
=-L
=-N
=-R
etc
Now, excel sees the "=" character and attempts to evaluate the expression. It cannot, and displays the following instead.
#NAME?
I would like the actual string "=-L" to be displayed instead.
I attempted to highlight the entire column and do
right click --> format cells --> Text --> OK
But the column didn't automatically update. I still see
#NAME?
where I should now be seeing
=-L
Now... if I double click the cell and then navigate elsewhere, it looks like the text value that is being displayed updates. However, I want the entire workbook to update so that I don't need to go through the hundreds of cells double clicking. I tried
F9
Shift + F9
ctrl + alt + Shift + F9
ctrl + alt + F9
etc.
Is there a way this can be done?
Replace all. Replace = with '=.
OR
Under Formulas in the Ribbon, Under (technically over) Formula Auditing, select Show Formulas. This applies to the entire worksheet.
In Excel it is pretty simple, for example
={1,2,3,4;5,6,7,8} gives us 2 rows in 4 columns.
But when I try similar in Google Spreadsheet, it fails.
EDIT: See comments below where the language version issue was revealed.
Nearly the same syntax, but different entry methods:
Excel
Hi-light a block of cells and array enter:
={1,2,3,4,5,6,7,8}
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.
Google Sheets
Select a single cell and enter:
={1,2,3,4,5,6,7,8}
and the extension to the other cells occurs automatically:
Same is true for 2-D arrays:
If you are using Google Sheets, remember to leave enough empty cells to the right and below to hold the result.
I have a formula in Excel that needs to be run on several rows of a column based on the numbers in that row divided by one constant. When I copy that formula and apply it to every cell in the range, all of the cell numbers increment with the row, including the constant. So:
B1=127
C4='=IF(B4<>"",B4/B1,"")'
If I copy cell C4 and paste it down column C, the formula becomes
=IF(B5<>"",B5/B2,"")
=IF(B6<>"",B6/B3,"")
etc.
when what I need it to be is
=IF(B5<>"",B5/B1,"")
=IF(B6<>"",B6/B1,"")
etc.
Is there a simple way to prevent the expression from incrementing?
There is something called 'locked reference' in excel which you can use for this, and you use $ symbols to lock a range. For your example, you would use:
=IF(B4<>"",B4/B$1,"")
This locks the 1 in B1 so that when you copy it to rows below, 1 will remain the same.
If you use $B$1, the range will not change when you copy it down a row or across a column.
In Excel 2013 and resent versions, you can use F2 and F4 to speed things up when you want to toggle the lock.
About the keys:
F2 - With a cell selected, it places the cell in formula edit mode.
F4 - Toggles the cell reference lock (the $ signs).
Example scenario with 'A4'.
Pressing F4 will convert 'A4' into '$A$4'
Pressing F4 again converts '$A$4' into 'A$4'
Pressing F4 again converts 'A$4' into '$A4'
Pressing F4 again converts '$A4' back to the original 'A4'
How To:
In Excel, select a cell with a formula and hit F2 to enter formula
edit mode. You can also perform these next steps directly in the
Formula bar. (Issue with F2 ? Double check that 'F Lock' is on)
If the formula has one cell reference;
Hit F4 as needed and the single cell reference will toggle.
If the forumla has more than one cell reference, hitting F4 (without highlighting anything) will toggle the last cell reference in the formula.
If the formula has more than one cell reference and you want to change them all;
You can use your mouse to highlight the entire formula or you can use the following keyboard shortcuts;
Hit End key (If needed. Cursor is at end by default)
Hit Ctrl + Shift + Home keys to highlight the entire formula
Hit F4 as needed
If the formula has more than one cell reference and you only want to edit specific ones;
Highlight the specific values with your mouse or keyboard ( Shift and arrow keys) and then hit F4 as needed.
Notes:
These notes are based on my observations while I was looking into this for one of my own projects.
It only works on one cell formula at a time.
Hitting F4 without selecting anything will update the locking on the last cell reference in the formula.
Hitting F4 when you have mixed locking in the formula will convert everything to the same thing. Example two different cell references like '$A4' and 'A$4' will both become 'A4'. This is nice because it can prevent a lot of second guessing and cleanup.
Ctrl+A does not work in the formula editor but you can hit the End key and then Ctrl + Shift + Home to highlight the entire formula. Hitting
Home and then Ctrl + Shift + End.
OS and Hardware manufactures have many different keyboard bindings for the Function (F Lock) keys so F2 and F4 may do different things. As an example, some users may have to hold down you 'F Lock' key on some laptops.
'DrStrangepork' commented about F4 actually closes Excel which can be true but it depends on what you last selected. Excel changes the behavior of F4 depending
on the current state of Excel. If you have the cell selected and are
in formula edit mode (F2), F4 will toggle cell reference locking as Alexandre had originally suggested. While playing with this, I've had F4 do at least 5 different things. I view F4 in Excel as an all purpose function key that behaves something like this; "As an Excel user, given my last action, automate or repeat logical next step for me".
TL:DR
row lock = A$5
column lock = $A5
Both = $A$5
Below are examples of how to use the Excel lock reference $ when creating your formulas
To prevent increments when moving from one row to another put the $ after the column letter and before the row number. e.g. A$5
To prevent increments when moving from one column to another put the $ before the row number. e.g. $A5
To prevent increments when moving from one column to another or from one row to another put the $ before the row number and before the column letter. e.g. $A$5
Using the lock reference will prevent increments when dragging cells over to duplicate calculations.
Highlight "B1" and press F4. This will lock the cell.
Now you can drag it around and it will not change. The principle is simple. It adds a dollar sign before both coordinates. A dollar sign in front of a coordinate will lock it when you copy the formula around. You can have partially locked coordinates and fully locked coordinates.
I want to take the left 5 characters of each cell in column E and put them into the adjoining cell in column F:
A...B....C...D......E..................F
123.bb...cc..dd.....90210ABCE13........90210
555.bb...cc..dd.....10056Z19s..........10056
Using Left(x, 5) function, how does Excel say "do this to every cell in the specified column"?
1) Put =Left(E1,5) in F1
2) Copy F1, then select entire F column and paste.
I find, if the data is imported, you may need to use the trim command on top of it, to get your details.
=LEFT(TRIM(B2),8)
In my case, I was using it to find a IP range. 10.3.44.44 with mask 255.255.255.0, so response is: 10.3.44
Kind of handy.
Have you tried using the "auto-fill" in Excel?
If you have an entire column of items you put the formula in the first cell, make sure you get the result you desire and then you can do the copy/paste, or use auto fill which is an option that sits on the bottom right corner of the cell.
You go to that corner in the cell and once your cursor changes to a "+", you can double-click on it and it should populate all the way down to the last entry (as long as there are no populated cells, that is).