有没有办法使用VLOOKUP内连接两个不同的Excel电子表格?
在SQL中,我会这样做:
SELECT id, name
FROM Sheet1
INNER JOIN Sheet2
ON Sheet1.id = Sheet2.id;
Run Code Online (Sandbox Code Playgroud)
工作表Sheet1:
+----+------+
| ID | Name |
+----+------+
| 1 | A |
| 2 | B |
| 3 | C |
| 4 | D |
+----+------+
Run Code Online (Sandbox Code Playgroud)
Sheet2中:
+----+-----+
| ID | Age |
+----+-----+
| 1 | 20 |
| 2 | 21 |
| 4 | 22 |
+----+-----+
Run Code Online (Sandbox Code Playgroud)
结果将是:
+----+------+
| ID | Name |
+----+------+
| 1 | A | …Run Code Online (Sandbox Code Playgroud) 在我的程序中,我希望用户:
在我的代码中,我有一个类,它做这样的事情:
mntmOpenDatabase.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//open the database
//display tables as buttons
tableButton.addActionListener(new ActionListener() { // select a table
public void actionPerformed(ActionEvent e) {
//display the columns of the table selected as buttons
colButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {// add to the list of columns to be exported }
Run Code Online (Sandbox Code Playgroud)
这导致了一个非常大的代码块.有更清洁,更简单的方法吗?
我有这个Prolog程序,我希望将玩家与具有相同级别(新手,中级或专家)和服务器的玩家匹配:
player(player29, 408, 183, europe).
player(player30, 462, 97, north-america).
player(player31, 25, 22, asia).
player(player32, 481, 248, asia).
player(player33, 111, 37, asia).
player(player34, 424, 359, north-america).
player(player35, 381, 358, asia).
player(player36, 231, 159, africa).
player(player37, 31, 20, africa).
player(player38, 22, 21, africa).
player(player39, 144, 35, oceania).
player(player40, 30, 25, asia).
player(player41, 221, 112, south-america).
player(player42, 344, 292, africa).
player(player43, 183, 148, asia).
player(player44, 62, 40, africa).
player(player45, 281, 23, north-america).
player(player46, 308, 173, south-america).
player(player47, 127, 125, asia).
player(player48, 441, 393, …Run Code Online (Sandbox Code Playgroud) 我想要做的是询问用户是否要创建新的或选择现有的 Excel 工作簿。选择现有文件没有问题。但是,一旦我为新 Excel 文件创建名称,就会收到一条错误消息,提示“您的文件似乎不是有效的 OLE2 文档”。
public void selectExcelFile() {
String excelFileName = null; // the name/directory/address of the excel file created/selected
FileInputStream excelFileIn = null; // allows us to connect to the Excel file so we can read it
FileOutputStream excelFileOut = null; // allows us to connect to the Excel file so we can write to it
ExcelFileUtility eUtil = new ExcelFileUtility(); // used open an excel file
if(columnsQuery != null) {
try {
excelFileName = eUtil.getFile(FileExtensions.XLS); …Run Code Online (Sandbox Code Playgroud) 如果日期在一个范围内,我如何只计算每日的总和?
我使用以下公式来计算我想要的日期范围:
开始:SUM(CEILING(A3 + 1,14)-1,-11)
结束:CEILING(A3 + 1,14)-1
在F5中,它应该是378.75美元.如果日期> = 2016-02-08和<= 2016-02-19,它将仅计算每日.在F9中,从2016-02-22和2016-03-04的日期开始,它将拥有自己的总数.
即使日期随A列随机放置,公式也应该有效.
更新:我这样做了:
= SUMIFS($ F $ 3:$ F $ 200,$ A $ 3:$ A $ 200,"> ="&SUM(CEILING(A3 + 1,14)-1,-11),$ A $ 3:$ A $ 200,"< ="&CEILING(A3 + 1,14)-1)