worksheet-function

Excel - Create chart from range of cells while excluding null values?

佐手、 提交于 2019-12-12 14:37:54
问题 I've got this Excel sheet which basically contains a lot of data. Now, this Excel sheet is updated dynamically via a macro that imports the data. So the data might change, meaning, some cells might be populated, while others won't. So I've got this formula in Sheet 2 in each cell from A2:A60 to M2:M60 which basically looks like this: =IF(Sheet1!E2<>0;Sheet1!A2;"") Meaning, if cell E2 on the row I'm in is 0, then the copied value in the new spreadsheet is nothing. Same goes for the next row:

Cell identifier number

自古美人都是妖i 提交于 2019-12-12 04:16:24
问题 I need to use a SUM function over an Excel range, for example, =SUM(A12:A25) . Is there a way to store the numbers 12 and 25 in another two cells and use them in the SUM function? 回答1: Yes, For example you might put 12 in B1 and 25 in B2 and apply: =SUM(INDIRECT("A"&B1&":A"&B2)) INDIRECT: Returns the reference specified by a text string. References are immediately evaluated to display their contents. Use INDIRECT when you want to change the reference to a cell within a formula without

Change data in vertical table to individual rows

馋奶兔 提交于 2019-12-12 02:45:54
问题 I have an Excel workbook with the following format: | A | B | C | D | E | |----|-------|-------|-------|-------| 1| | po#1 | po#2 | po#3 | po#1 | 2| | date1 | date2 | date3 | date4 | 3|sku1| qty1 | qty4 | qty7 | qty10 | 4|sku2| qty2 | qty5 | qty8 | qty11 | 5|sku3| qty3 | qty6 | qty9 | qty12 | that I need to convert to the following format: | A | B | C | D | |--------|-------|-------|-------| 1| po#1 | date1 | sku1 | qty1 | 2| po#1 | date1 | sku2 | qty2 | 3| po#1 | date1 | sku3 | qty3 | 4| po

Accessing Vlookup Macro Code in Excel?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 02:45:53
问题 I wish to manually code VLOOKUP in python, so is it possible to see the VBA code behind VLOOKUP? I remember a presentation in my school by a guest speaker showing that the Excel Functions are just macro/vba codes. Can someone please show me the way to view the code for Excel Worksheet functions? 回答1: I do not know of a way to view the XL code for VLOOKUP (its almost certainly written in C). The basic algorithms used in VLOOKUP are Linear Search for unsorted data, and Binary Search for sorted

Detecting what value was in a cell prior to a change

ぐ巨炮叔叔 提交于 2019-12-11 23:16:48
问题 Is there a way to detect what a cell use to contain before it was changed. I'm trying to perform actions based on what the previous value was in a cell. I know there's Worksheet_Change but the Target it uses is the new value. 回答1: You can undo the change, populate the undone value to a variable then redo the change like so: Private Sub Worksheet_Change(ByVal Target As Range) Dim OldValue As Variant, NewValue As Variant NewValue = Target.Value Application.EnableEvents = False Application.Undo

Excel - logic for skipping rows in a formula

♀尐吖头ヾ 提交于 2019-12-11 19:38:54
问题 I am trying to do the following via a formula rather than VBA/macro (i do not want a copy/paste special solution as i need more control). is it possible to: I have a column in which there are some blank rows and some rows with values. let's call that column A. In column b, i only want to copy the cells if the column A has a value. if it doesn't, i want it to skip to the next cell in column A, but stay on on the same cell for column b. Column A 1 2 [blank] 4 [blank] 6 i want column b output to

Loop to Collect Labels and Formulas on Dynamic Columns

荒凉一梦 提交于 2019-12-11 17:15:00
问题 Example Code: Sheet1 has data format sheet3 has basic desired output https://drive.google.com/open?id=1aXn230d-7zh68w6FJN0qpZ6R0rI31HSE Code to collect labels: Sub GetData() Dim ArrPK() As String, SearchString As String Dim SerialNo As Range, aCell As Range Dim ws As Worksheet Dim PkCounter As Long Dim LstBox As msforms.ListBox Set ws = ThisWorkbook.Sheets("Sheet1") SearchString = "Serial#" Set LstBox = UserForm1.ListBox1 PkCounter = 1 With ws Set SerialNo = .Range("A1:A" & .Cells(.Rows.Count

shifting a load of Electric Vehicle to the next row if a condition is not fulfulled in excel

烈酒焚心 提交于 2019-12-11 15:17:29
问题 I am making a scenario in excel where Electric vehicles are being charged in a given time range. i have a neighborhood loads and the load of EV at specific times. the cable capacity is 50 kW (means the combined load of EV and household should not exceed this value). is there a formula, which checks if the combined load of EV and household is below 50 kW, then leaves it unchanged. if it is more than 50KW then shifts the EV load to next row and checks for the condition again if satisfied it is

How to return the header by value in a PivotTable

醉酒当歌 提交于 2019-12-11 13:14:30
问题 I have a PivotTable like this: Sum of Gf_Amount | Column Labels | 2015 | | | | Grand Total Row Labels | 17-Mar | 18-Mar | 19-Mar | 20-Mar | 3601 | 20 | 20 | | | 40 10386 | 35 | | | | 35 76301 | 5 | | | | 5 80941 | | | | 10 | 10 205738 | | | 5 | | 5 219576 | | 15 | | | 15 Grand Total | 60 | 35 | 5 | 10 | 110 What I want do is find the last non-empty column and return the date according to the value. For example: for ID 3601 the result should be 2015 18-Mar . Currently I know how to find the

Conditional formatting for cells when cell above has the same value

独自空忆成欢 提交于 2019-12-11 11:51:53
问题 Is it possible to apply conditional formatting to a whole sheet such that whenever the cell above the current cell has the same value (either text or number) as the current cell, the current cell will be formatted yellow fill/blue font? For example, when cell: A1 is blank A2 AAA A3 AAA A4 AAA A5 is blank A6 AAA A7 AAA only cells A3, A4 and A7 will be formatted with yellow fill and font blue. 回答1: While in A2, please try a Conditional Formatting formula rule of: =AND(A1=A2,A2<>"") with Applies