I'm after some pointers.
I want to input text into some cells based on the contents of others.
Current formula that I'm using in cell B1 is
=IF(ISERROR(FIND("example",A1)),"no","yes")
So far, so simple. This works. Inputs 'yes' in B1 if 'example' is located in the cell A1, copy down.
However, there are some cells in the B column which have already been formatted with other text in, and I want to apply this formula on the entire spreadsheet without removing the existing text in column B. So far, the only thing I can think of is by putting this formula in the C column, copying down then moving the text from the C column to the B column - but this requires laborious copy and pasting that kind of negates the time saving provided by the formula.
What is the best way to achieve this? Do I need to resort to VB to scan the entire sheet, iterating through A1-A30000 and inserting the requisite text in B column?
Cheers.
Edit:
So, this has been pretty much sorted, with a variety of suggestions.
However, the actual formula I'm using is:
=IF(ISERROR(FIND("example",A1)),"","yes")
as I only want text to be put in columnB if the pattern is found. This has presented another problem! The double quotes signifying no replacement if the pattern ISN'T found actually inserts a 'NULL' character in there; when you try and select the blank cells on the next iteration of the operation, no cells are selected, as even though there is no visible character, Excel thinks there is. xD
This is solved by writing a macro function to remove Null characters.
Excel is infuriating sometimes. :P
All of the information and advice already given is definitely correct and gets the job done,
byt thought I'd add one that does not require ANY changes to the existing data (eg sorting or filtering):
Put your formula as you described is cell B1. Apply any conditional formatting to that cell, as required.
Now select and copy (ctrl+C) cell B1. Select column B (click on column heading).
Then Click find and Select (binoculars icon) - on Home ribbon tab. Choose go to Special.
In the popup choose Blanks and click ok. You will note all blank cells in colum B are selected. Don’t click anything, press Crtl-V.
Voilà, your formula and conditional formatting is pasted into all blank cells, leaving the rest alone.
Quick keyboard sequence:
select B1
Press ‘Ctrl + C’
Ctrl + ‘Space Bar’
Press ‘Ctrl + G’
Press Tab twice to go to ‘Special…’ button, press Enter
Press ‘K’ for blanks, Press Enter
Press ‘Ctrl + V’
(optional) press escape to remove selection from B1
There are a few ways to deal with this. I'll explain 2 of them :
If sorting is an option, sort your table by column B (ascending / A-Z) to get all the empty values at the top. Write your formula in the first blank cell and extend it by double-clicking the bottom-right corner of that cell.
If you cannot sort, apply filters to the table and select only the blank cells in column B. Then write the formula in the first blank cell and extend it by dragging it down to the last cell.
You might combine your existing B column values with those to be added conditionally in a single formula, say in ColumnC, such as:
=IF(ISBLANK(B1),IF(ISERROR(FIND("example",A1)),"no","yes"),B1)
copied down to suit. Then if ColumnB has become redundant, copy ColumnC, Paste Special, Values over the top and delete ColumnB. The result is to convert the formulae to the results thereof, that may increase processing speed but reduce the ease of handling additional rows (if any) subject to the same requirements.
Related
I have one column in excel that contains the source ip in the first cell then on the next row contains any open ports for that source ip. for the cells that contain the port number they are all right aligned. I am trying to find out how I can move all of the port numbers over to the next column called "Ports" in excel.
The fastest way I can think of is using Goto feature.
First you need to copy the entire list in column A to column B.
Then, using Goto, select all numbers in column A. To use Goto, select column A then press F5. Then click on Special. You will see below dialog box. Tick Constant and Numbers as seen below and press ok.
After executing step 2, all numbers will be selected as seen below. Press delete.
Repeat steps for column B. This time, you select Constant and Text. Then delete.
There you have it, you've transferred all the port numbers in column B under ports. This is assuming all your IP's are text and all your ports are numbers.
Select Cell A1
Press CTRL+SHIFT+↓ (i.e. Down Arrow)
Release CTRL and press → (i.e. Right Arrow) twice
Go to "Insert" and create a table. (unckeck my table has headers)
Add the following text to Cell B2: "=IF(ISNUMBER(A2);"";A2)"
Add the following text to Cell C2: "=IF(ISNUMBER(A2);A2;"")"
Copy the result of row B and C to another sheet. In paste options you need to select that it only pastes values (thing with numbers).
https://www.ablebits.com/office-addins-blog/2018/11/28/remove-blank-cells-excel/
Image below shows it but it is in German.
I'd like to create a rule that writes "100%" in column A whenever I write "end" in column B.
So it would be something like this:
[] X
100% end
[] Y
The brackets represent an empty cell.
I've tried:
IF(B1:B3="end",100%,"")
but I would like to leave the cells on column A empty, with no data or formulas, if the respective cell in column B doesn't contain "end".
So I've thought about adding a new rule with conditional formatting but it's not working. Any solutions?
Can be achieved with CF but rather nastily. You would need to fill ColumnA first, say with 1s - but can be hidden by (standard) formatting the text to match the background colour (ie usually white).
Then clear any CF from and select ColumnA, HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=B1="end"
Format..., select Black (probably) font and Custom Number format of:
00%
OK, OK.
If your blank cells must remain blank in reality rather than appearance then CF alone is not a solution for you.
Edit:
You can get a value to show in a cell based on the value of another cell, without having anything* in the cell, and without VBA:
*kinda
Using cells I2:J9 as an example, the steps are:
Click I2, then Ctrl+1 to open the Format Cells dialog.
On the Number tab, click Custom, then in the Type box enter: ;;; and click OK.
Hit Alt+O+D+N to add new Conditional Format and choose Use a formula to determine which
cells to format.
In the Format values where... box, enter: =J2="end" (If Excel adds $'s, remove them), then click Format...
On the Number tab, click Custom, then in the Type box enter: ;;;"100%" . (Optionally set a color, font, etc.) then hit ENTER 3 times to return to the
worksheet.
Click I2, hit your SPACEBAR once and then hit ENTER. (* Fine, I
confess: the cell isn't totally empty.)
Click I2 and hit Ctrl+C to Copy.
Select I2:J9 and press Alt+E+S+T then hit
ENTER to Paste Formats.
Now when you type end into any of J2:J9, the corresponding cell in column I will display 100%.
You can also repeat this process to add additional conditions to the same cells if needed.
Original Answer: (Alternative Solutions)
Sometimes I get stuck spending too much time on a question about a very minor issue. This is one of those times. :)
Thinking further about your question, I suspect you might not have meant you need the "cells on column A empty, with no data or formulas", but perhaps you mean you want the cells to "appear empty".
Example:
These cells do appear empty, unless you to click on the cell and then look at the formula bar:
...but the formula bar can be hidden too:
Column A contains leave dates, Column B contains clinicians. Data was extracted from VISTA and only includes leave date for first employee listed. Is there an easier way than copying and pasting to extend the dates in column A to include each employee? Most likely I would be working with over 50,000 total rows ( at least to begin with), so I would prefer to avoid copying and pasting.
Here is what the data currently looks like:
enter image description here
Here is what I would like the data to look like:
enter image description here
Follow these steps:
Select entire column with Dates
Press Ctrl + g
Click Special...
Select Blanks
Click OK
With the blank cells selected (and assuming the first blank cells is A3) put this into the formula bar: =if(B3<>"",A2,"")
Instead of pressing Enter to save the formula to just the first blank cell, press Ctrl + Enter to save it to all selected cells
Right click on any selected cell and change the format to Date (Screenshot below at this point)
Select the entire column A again, then copy and paste special as values to convert the formulas to date values that you can sort/filter on. (Let me know if you need more detail on this step)
I am trying to substitute a specific part of a formula for the text contained in a different Cell.
The formula is:
=SUMIFS(Data!$C$2:$C$300000,Data!$O$2:$O$300000,"c285",Data!$G$2:$G$300000,">"&DATE(2017,1,1))
This formula is the same all the way down my spreadsheet although it should only be in cell O1. I want to change the part of the formula that says "c285" to match the value in the cell in each row
Is there a way to do this without me doing it manually?
The forumula can be seen in all the cells in Column O, they are all the same as they all have the same formula at the moment
Route 1:if you want to do it programmatically -> take a net language of your choice
take the cell content, search for the position of C1, change that to C +iterator
save it to the cell
Route 2: change the first few cells, delete the rest. Select all the correct cells, click on the right corner, pull down till you got all your rows auto completed
(this works for simple formulas, dates and so on. You would have to test this)
And always have a backup copy
I was wondering how to add the same drop-down value (e.g. Yes or No) to multiple cells in the column at the same time? I tried selecting individual cells that I need to fill with the same value using Ctrl, and then selecting the value from the drop-down menu, but it only fills the single highlighted cell.
Is there a quick way to select cells and then add the same drop-down value simultaneously to all of them?
I'm using Excel 2013.
Thank you!
Place the drop-down in the top cell. Then select the block of cells (including the top cell) with either the ARROW keys or the mouse and touch Ctrl + d
i also found no answers for this online so came up with my own solution.
It is using macros but only a basic knowledge of how to record is needed so its very easy.
Once your drop down lists are set up, you would start with Sheet 1 and simply record a macro where you are copying the value you selected in sheet 1 and then pasting into sheet 2. then assign this macro to a button on sheet 1. every time you click the button, it will copy and paste the selected value in your sheet 1 drop down into sheet 2.
you would then do the same thing in sheet 2, except that you are copying the value into sheet 1.
you can do this for any number of sheets.
hth.
I tried it as follows and it worked:
Select a cell and select the value for it (yes or no for example). Then select the group of cells you wan to have that same value - include the original cells with the value (yes or no)as the top cell in the range. Hit ctrl and D and all the cells will fill with the value in the top cell.
I accomplished this task in Excel 2013 by doing the following:
Select the cell with the drop down response
Scroll down to the last cell in the row that you want to have the same answer
Press the shift key
Select the last cell in the row that you want to have the same response
Release shift key and scroll back up to the first cell that you highlighted
Select your response in that cell
Hit Ctrl+D (to duplicate response).
I'll try and explain a little more clearly for you.
Select, with your mouse, the top most cell in the column you want to make all YES, scroll down if you need to and then, before clicking anything hold the SHIFT (not CTRL) key while you click the bottom cell in the row you wish to update.
This should highlight all of the cells in the column from the first, to the last you clicked. Now, release the SHIFT key and select YES (or no) in the top cell. The top cell (only) will change to YES (or No if you selected that). Now, without clicking doing anything else, hold down CTRL and while holding it press D.
If done correctly, all of the highlighted cells will now match the top cell.