Overview
The OP basically wants to be able to use the spreadsheet functions over the original data without having to scroll across a large number of rows and columns. His background make him think about having custom views and a easy way to change from one to another but Google Sheets doesn't have a built in feature to manage custom views.
Fortunately the fourth requirements are doable by using built-in features and Google Apps Script
Rows could be hidden by using filters but columns only could be hidden manually or by using code.
For 1, and 2 use Google Apps Script to create custom menus that apply the hide/show columns and optionally rows over the "master sheet". This will allow the user to edit the data directly over the "master sheet" and sort it.
Code example
The following code creates a menu for handling the hide/show operations of columns specified in a global variable.
var cols = [1,5,7]; //columns to be hidden/shown
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [
{name: "Hide", functionName: "hideCols"},
{name: "Show", functionName: "showCols"}
];
ss.addMenu("Custom Views", menuEntries);
}
function hideCols() {
var sheet = SpreadsheetApp.getActiveSheet();
cols.forEach( function(col) {
sheet.hideColumns(col);
}
)
}
function showCols() {
var sheet = SpreadsheetApp.getActiveSheet();
cols.forEach( function(col) {
sheet.showColumns(col);
}
)
}
Instead of filter views, I would use the filter
command. For example, suppose Sheet1 holds raw data, with A being a character, B the list of "mentioned" chapters, and C the list of "appeared" chapters. You can then add another sheet for "filtered" data, where the user enters chapter number in, e.g., cell A1 and immediately get the list of rows matching that number thanks to the command
=filter(Sheet1!A2:C, regexmatch(Sheet1!B2:B,"\b"&A1&"\b") + regexmatch(Sheet1!C2:C,"\b"&A1&"\b"))
Here, each regexmatch
scans its column (B or C) paying attention to word boundaries (\b
) so that, e.g., "20,23,25" would not match "3". Addition plays the role of OR operator here.
If you are sharing this, you can allow editing but protect all cells except A1 on the second sheet: this way, the users can only change the chapter number for filtering.
There is a potential drawback: the changes to A1 are actual edits; i.e., what one user does affects everyone. If this is unacceptable, then filter views are the only option. You can circumvent the "OR" issue by creating a new column with
=B2&","C2
i.e., concatenation of columns B and C. Then apply filter views based on that column. However, the filter view will require either
- custom formula with regexmatch as above (not user-friendly at all)
- different format of data to make the condition "text contains..." work: for example, you could format as
,2,4,10,13,16,
so that the text to search for would be ,4,
(Otherwise, there's the same issue of "13" matching "3".)
Best Answer
No.