excel-formula

How do I stop a formula if the cell is blank?

柔情痞子 提交于 2021-02-05 09:32:15
问题 How do I stop a formula from running if there is no data in the cell to the left? I'm trying to work out how to display elapsed time using a fixed time and a dynamic clock. My fixed time is in Cell D5 and my dynamic clock in Cell J4 (picture attached). To work out 'elapsed time' my forumla is as follows; =J4-D5 , which works fine. However, when I copy the forumla down if there is no data in cells D6,D8,D9 etc, then it will just display the current time. Is there some error checking that I can

Have more than one Worksheet_Change in a Worksheet

别等时光非礼了梦想. 提交于 2021-02-05 08:58:48
问题 I am looking to limit my workbook users to 1000 characters over a range of cells (Example: A5:A30) . In other words limit the total characters in the range A5:A30 to 1000 characters. When a user fills in a cell that sends the range over the 1000 character limit, it will call Application.undo which should just remove the last text that they added. However since I have another Private Sub Worksheet_Change(ByVal Targe As Range) on the worksheet, it causes a bug. Below is both Worksheet_Change

Structured References: Absolute and Relative addressing

只愿长相守 提交于 2021-02-05 08:31:22
问题 This is a "weighted average" formula where Q14:Q21 contains the "weights"; Column C is the first column of data, and subsequent columns are D:P I can use this formula, and fill right. The data columns will change and the "weight" column remain the same. =SUMPRODUCT(Sheet1!C$14:C$21,Sheet1!$Q$14:$Q$21)/SUM(Sheet1!$Q$14:$Q$21) I would like to change the data to a "table" so as to be able to use structured references. The "weights" column header is Percent , and the data columns are year numbers

Keeping cell references the same when applying formula to entire column

北战南征 提交于 2021-02-05 08:21:04
问题 I have this formula here: =IFERROR(IF(D4<=0,0+(VLOOKUP(A4,'Civil Maintenance'!A5:C46,3,FALSE)),_ C4+(VLOOKUP(A4,'Civil Maintenance'!A5:C46,3,FALSE))),"0") As you all know when you drag it down to copy the formula to other cells in the column, it adds one to all the references (D4 becomes D5 etc.) However i was wondering if there's a way to stop this for certain parts? I want to keep the lookup search area the same so that A5:C46 stays the same in all formulas of the column but i still want

Excel - Formula to create an array of lookup values based on a criteria

天涯浪子 提交于 2021-02-05 07:59:06
问题 I was looking for the solution for this apparently easy problem, but failed so far. I have a table in Excel like this: Column 1 Column 2 apples 1 apples 2 bananas 5 apples 3 bananas 4 What I need is a formula that returns an array of the values in column 2, based on the criteria on column 1. So if I choose "apples", my output array should be {1,2,3}. That output should be compatible for use inside of a standard SUM(SUMIFS()) formula. Thanks in advance for any insight Regards, André Edit: The

Extract numbers from cell in Excel

本小妞迷上赌 提交于 2021-02-05 07:49:32
问题 I've got a column where cells contain phone numbers in the following format: To: +6112312414 Will Smith To: +61832892357 Tom Hopkins To: +447857747717 Julius Caesar Or From: +44712423110 Jack Russel To: 112312414 Mr XYZ To: +61832892357 Hulk I need to extract the recipient phone numbers in a separate column, names not required e.g. +6112312414, +61832892357, +447857747717 for the first example and 112312414, +61832892357 for the second example. Can someone please help with this? Thanks! 回答1:

How to create a filtered drop down list based on multiple criteria

六眼飞鱼酱① 提交于 2021-02-05 07:09:56
问题 on the below Schedule image I am trying to create a Drop Down List in the " Gland (A) " Column. Rather than just creating a list of all available " Glands " I want that list to be filtered based on the data within " CORES / PAIRS ", " SIZE mm " and " CABLE TYPE ". For this example we will use a "3c 16 BS5467, XLPE/SWA/PVC". Schedule To determine the filter for the list, the " ID Ø (mm) " and " OD Ø (mm) " for the select cable need to be taken in to consideration, see Cables image below. As

Sort Excel VBA Number and Text Array with FUNCTION [duplicate]

北慕城南 提交于 2021-02-04 08:28:35
问题 This question already has answers here : VBA array sort function? (13 answers) Closed 11 months ago . If I have values in cell A2=2,4,8,6,12,19,18,23,35,78,101,38,30,205,2 And I want to sort by smallest to largest or largest to smallest in cell B2. then my desired result should be =2,2,4,6,8,12,19,18,23,30,35,38,78,101,101,205 or,Large to small= 205,101,101,78,38,35,30,23,18,19,12,8,6,4,2,2 if I have textvaluse like in A3= WPN/01,AFF/02,PROP/4,ENG/03 Then I want to sort alphabetically my

Excel Time Comparison and Subtraction

眉间皱痕 提交于 2021-01-29 19:57:28
问题 I am trying to do a time subtraction in excel of 30 minutes and I am running into a speed bump. So the table I have are as follows. Table "Schedule" Column 1 is day of the week (Mon-Sun) (formated as general, as this is plain text) Column 2 is start time of the shift (formated as h:mm AM/PM) Column 3 is end time of the shift (formated as h:mm AM/PM) Column 4 is duration of the shift (start to end) (formated by formula (TEXT(col3-col2,"h:mm")) ) Column 5 is paid hours (if the total hours is

Need to transpose the vertical data to horizontal format, but few cells in Vertical format can have more than 2 or 3 sub categories in Excel VBA

喜欢而已 提交于 2021-01-29 19:35:58
问题 This is BEFORE image This is AFTER Image 回答1: It is based on the assumption that your original data is still listed in the column direction. Sub test2() Dim Ws As Worksheet Dim toWs As Worksheet Dim vDB, vR() Dim rngDB As Range Dim i As Long, j As Long, n As Long Dim r As Long, c As Long, k As Long Set Ws = Sheets(1) Set toWs = Sheets(2) Set rngDB = Ws.Range("a1").CurrentRegion vDB = rngDB r = UBound(vDB, 1) c = UBound(vDB, 2) For j = 2 To c n = n + 1 'ReDim Preserve vR(1 To 4, 1 To n) ReDim