I am trying to create a vocabulary quiz in excel, where a correct answer is the only possible input into a cell. So far, I use data validation to ensure that outcome, but cannot figure out a way to batch edit data validation. I want every blank cell's validation to equal the adjacent cell, which contains the correct answer. I was hoping that copying one correctly formatted cell and pasting it in an empty cell would cause the new cell to reference the new adjacent cell, but have found that the new empty cell still validates according to the old cell. In other words, I would like the cell's data validation to copy and paste sequentially, like when you drag a cell containing the number 1 and the cells below populate with 1, 2, 3, etc.
This is a problem that has to do with efficiency. I could accomplish what I want by data validating every cell to its adjacent "by hand," but it takes a very long time with large amounts of data. I've tried conditional formatting as well--a correct answer turns the cell green--but have run into the same problem.
Any help would be greatly appreciated.
Thanks.
Not sure how you did the copy/paste, but it should work fine. Here is an example.
Set up the initial data validation. I am using the List version of it with a single cell reference. Note that the single cell reference is defined relatively (no dollar signs in it). I removed the In-cell dropdown option so the answer isn't visible!
Now if I copy that cell and paste one cell below, it will apply the data validation with the range updated. I did this with a simple copy of C6 and paste into C7. I changed the value to b after the paste to not get the error. When I open the validation for C7 I see the new range (D7).
You can paste to a larger range than 1 cell and it will update all of the references accordingly.
Related
Whenever I do a dependent dynamic drop down list , I see a bunch of blank cell in the drop-down list , I search many topics that explain how to remove them while by adding two additional ranges like explained her http://blog.contextures.com/archives/2014/02/27/dynamic-list-with-blank-cells/
but my question is: Is there anyway to avoid blank cell or remove them using a simple approach without the need of two additional ranges or a complex formula?
the drop down list that contains blank cell all I did is go to data validation and wrote in source =MYCode then I named the list that contains the codes like that MyCodeand I checked ignore blank case (even tho It seems to be useless )
There is another way. Create a dynamically-expanding named range. Then use the range to define the data validation list.
To create your dynamically-expanding range, insert this in the named range box and give it a name:
=OFFSET($A$1,0,0,COUNTA($A:$A),1)
$A$1 should be replaced with the top cell of your range. $A$A should be replaced with the column(s) the range is in.
OFFSET points the named range at a range of cells. COUNTA() is in the fourth position of the OFFSET formula, which sets the height of the range. It counts the number of non-blank cells. As a result, when you add a value, the fourth value of the OFFSET formula increases and you get an expanding range.
Note, this does not work if your named range has blank cells interspersed.
OFFSET formula from excel-easy.com.
After some more research I found a solution. In the cell where my information is filled I added a name using the name Manager and I added this formula that I adapted from this article:
=DropList!$J$1:INDEX(DropList!$J$1:$J$10000,SUMPRODUCT(--(DropList!$J$1:$J$10000<>"")))
It did what I needed without the need of adding 2 extra cell, even though the line of code is rather complex.
I know this thread is dead but I found a simpler solution which only requires you to create a single named range. It also works even if blank cells are interspersed in the source data, and expands as the source data expands.
First create your dynamically expanding named range using the formula given above:
=OFFSET($A$1,0,0,COUNTA($A:$A),1)
This will includes the values you want in your drop-down, as well as blank cells.
Next, in a separate cell, enter the following:
=FILTER(Your_Range, Your_Range <> "")
The result will be your source data with no blanks. This will spill into adjacent cells. Now can reference this single cell as your data validation list, as long as you add "#" to the end of the cell reference. This tells excel to include all the spilled values in the list.
Benefits:
If your source data named range is dynamic, the drop-down list will expand with this range, and you don't have to worry about updating a second named range.
You can easily filter more data, and it doesn't matter if blank cells are interspersed.
Combined with the SORT and UNIQUE functions, you can further improve how your data is represented in the drop-down list.
I couldn't find a solution this simple anywhere else, so I hope someone finds this useful.
If there are no empty cells within the source list, but the empty rows come from the end of the list, you can get rid of those by using a table as the source of the dropdown. You have to use the INDIRECT function to refer to the table:
Select the whole source list including the header
Click Format as table
Select the table, go to the Design tab (under Table Tools)
Rename the table
Select the cells where you want to use the dropdown and open the Data Validation
As the dropdown source, set: =INDIRECT("TableName[ColumnName]") (note the double-quotes)
This article explains the procedure in more detail
I'm hoping someone can help me make better use of the INDIRECT formula.
I have a list of sheet names in a table and an INDIRECT formula that uses that list to return a value in a specified cell - the list of sheet names is just an easier way for me to drag the formula down the table and read the appropriate cells without having to manually link each sheet.
=INDIRECT("'"&A2&"'!"&"K10")
This works fine for single cells as the range ref is simply stated as the text in the formula (K10), the problem arises when I need to start referring to a range such as K10:K15 and summing the values.
The range K10:K15 will inevitably have new rows added or deleted on the relative tab and as INDIRECT is using text as the reference it means the range doesn't automatically adjust - this is as I understand it one of the 'benefits' of INDIRECT but in this case is actually holding me back.
Also worth noting that the range (K10:K15) may move as rows are added/deleted above this, as this range is part of a larger table.
In simplistic terms I want to achieve the same result as a standard reference to a range on another sheet, e.g. =sum(sheet1!K10:K15) (as this will adjust when rows are added/deleted) but I just want to be able to dictate which sheet is referred to via a list I have in a table on a summary sheet.
How do I either write INDIRECT so the range adjusts when new rows are added/deleted or is there a different formula I should be using that achieves this?
Any advice greatly appreciated :)
=INDIRECT("'"&A2&"'!K"& MATCH(TRUE,INDIRECT("'"&A2&"'!K:K")<>"",0)&":K"&MAX((INDIRECT("'"&A2&"'!K:K")<>"")*(ROW(INDIRECT("'"&A2&"'!K:K")))))
This indirectly references the rows from the first non empty cell up to the last non empty cell in given sheet in column K. Not sure if you need to enter with ctrl + shift + enter (not in the app version).
Note: If the range contains empty cells in between the first and last non empty cell it will be included as value 0
Or in office 365 use the following:
=FILTER(INDIRECT("'"&A2&"'!K:K"),INDIRECT("'"&A2&"'!K:K")<>"")
I am looking for a formula to always use the cell above if the cell below is blank. If the blank cell is then filled out I will need the statement to jump to the next cell below it.
Lets assume your data is layed out as per the image below and your want your formula to go in the yellow cell. You want the last entry in the cells below, and you want the data from the cell above if there are no entries below.
The sticky part of this solution in that it uses a function that performs array like calculations. As such you should not use full column references. Without knowing what you data layout is it makes it difficult to automate a few things. For this particular solution I am assuming you will not have any other information below the yellow cells other than certificates. I have also assumed you wont have any certificates added past row 20. Feel free to adjust this number to suit your needs, however avoid full column references within AGGREGATE as you will be performing a bunch of useless calculations on empty cells that can bog down your system.
Used the following formula in the yellow cell B3 then copy to D4:
=IFERROR(INDEX(B:B,AGGREGATE(14,6,ROW(B4:B20)/(B4:B20<>""),1)),B2)
I am trying to drag the bottom right corner downwards to copy some data and it always increments my numbers that I want to copy. If I select copy cells in the auto fill options then it copies the numbers properly but also copies the formatting, but if I select fill without formatting it increments the numbers. I want both. My first cell has a strong border above it that I don't want every cell to have. However my data is in semi small increments of the same problem so copying the first cell once then dragging would be way to inefficient. Thanks for the help.
Original data example
Using copy cells, right numbers wrong formatting
Use the following formula in the any one of the columns you are not using and drag it down to the end of data. Then copy the result to your column E as values. If your helper column is N then:
=IF(E3<>"",E3,N2)
What I usually do in these situations is separate the values from the formatting.
make a copy of the column you want to edit (either adjacent to it,
or outside the table you're editing).
On the new column - use copy cells in the autofill menu, or
otherwise complete the values according to your needs.
paste the new column back on the original column As values.
Delete the new column
I am making a series of cascading dropdowns in Excel. When a user selects an option in ColumnB, the sheet finds a list "Name"d = ColumnB value and set the validation for that column with that list.
It is working fine
But when I drag the cell in the whole column and try applying the Data Validation property to all cells, instead of selecting the previous cells respectively, it is defining every Data Validation property with the specific cell with which the first cell was binded.
It is not much of a problem as I can do that for individual cell, but I will be setting the data and names through code later, so I need to find a way that every Data Validation source contains a reference to its previous cell instead of that one specific cell.
Remove the $ sign. $ sign means that the reference is absolute and the cell reference in the formulas won't change when the cell is dragged or copied.
Another solution is to define the data validation for the entire column and you don't have to drag anymore.