worksheet-function

Excel date/time difference

廉价感情. 提交于 2019-12-10 09:48:04
问题 I would like to work out the current time since a date and time specified. If the specified data is : 19/01/2013 16:44:00 and now the time is : 19/01/2013 16:45:00 the difference is 0 years 0 months 0 days 0 hours 1 minute 0 seconds This can be done easily just by taking the current time and minus the previous time and format it but this is hard to crunch data so what I wish to do is break each date/time segment into its own cell Let's say cell A1 has the previous time and cell A2 has the

How do I sum a named range of values that contains errors?

你。 提交于 2019-12-10 05:21:23
问题 I have an Excel spreadsheet which imports data from another source that I need to run a calculation on. The data I need to work with is in a named range - it happens to be in the range C12:C36 - but it's called "SumData". The values in this range contain a number of errors currently including #NUM! and #N/A, but could potentially contain other errors. I need to sum these values. I understand how to do the sum formula: =SUM(SumData) Or =SUM(C12:C36) I can also use IFERROR to check for errors:

Excel search for cell references in formulas

不想你离开。 提交于 2019-12-09 08:27:35
问题 I inherited a big model and have been trying to reverse engineer some of the formulas. There are a lot of fields. I am not sure if everyone of them is necessary. Is it possible to search an Excel document (with 5 worksheets) to find if say, AZ12 is used in any formula? Or $AZ12 or $AZ$12? 回答1: Tools > Formula Auditing > Trace Precedents or Trace Dependents (Excel 2003) Formulas > Trace Precedents or Trace Dependent (Excel 2010) 回答2: I bought the add-in Formula Manager to do this. If you want

Adding up all the positive numbers in Excel

感情迁移 提交于 2019-12-08 21:41:17
问题 Is there a way to add up all of the positive numbers in a row/column but ignoring all of the negative numbers? Like SUM(), except that it ignores negative numbers. Would I have to use VBA? If so, how would I do it in VBA? If it can't be done in Excel, can it be done in OpenOffice Calc? 回答1: Use SUMIF. YTo sum all the positive numbers in Column A: =SUMIF(A:A,">0") Same function exists in Excel and Calc 回答2: =SUMIF(A1:A99,">0") 回答3: Sure like this: =SUMIF(B1:B50,">0") This will add all positive

Sum cells in a column that have a specific value in a cell in their row

十年热恋 提交于 2019-12-08 18:15:02
问题 My table is as follows... Timestamp | Category | Cost -------------------------------- ... | Shopping | 5 ... | Charity | 10 ... | Dining | 20 ... | Mortgage | 1000 ... | Dining | 30 etc... What I need is a formula for each category value that will get the sum of the cost column for rows that have that category. ie. total spending in that category that I can place in the "actual spending" cell in my budget table. The data is input with a google form so I have almost no power over formatting.

How to SUM the number of duplicates in a range by given value?

隐身守侯 提交于 2019-12-08 05:36:06
问题 A simple example as below: Column A is the list containing all data Column B is the list of all unique data in Column A without duplicates Column C will be the number of duplicates for each item in Column B from Column A How to write a easy formula for cells in Column C to sum each item in Column B from Column A? I used =sum(lookup($a$1:$a$10=$B$1)) for C1 but received: too few arguments for this function . 回答1: A simple countif() should suffice unless I'm misunderstanding.. =COUNTIF($A$1:$A

Multiple targets with different macro calls in worksheet_change VBA code

谁说胖子不能爱 提交于 2019-12-08 00:53:38
问题 I would like to use worksheet_change() to run macro1 if cell1 is changed, macro2 if cell2 is changed, etc. I understand that worksheet_change() only allows target and sh, and that only one sub can be used. I thought I could run something like: Private Sub Targets(ByVal Target As Range) Select Case Target.Address Case "cell1" Call SheetChange.macro1 Case "cell2" Call SheetChange.macro2 Case "cell3" Call SheetChange.macro3 End Select End Sub But, apparently I cannot! I also tried Private Sub

How to create a spreadsheet with formulas using Rails?

£可爱£侵袭症+ 提交于 2019-12-07 15:57:29
问题 I need some gem/plugin to create an Excel spreadsheet with formulas to use in my Rails application. Any suggestions? 回答1: I've used Roo and it's quite good and easy to do spreadsheet processing (once you get all the gem dependencies installed). However, it doesn't support formulas natively. It won't eval the formula and return the result (this would be difficult I think -- use the excel engine?) but it will give you the text of the formula, for example: =SUM(.A1,.B1) It'd be pretty easy to

How can I substitute quotation marks in Excel with SUBSTITUTE formula?

徘徊边缘 提交于 2019-12-06 18:33:31
问题 I have worksheet where I need named ranges to correspond to the contents of another cell. The text in the cell is something like: Partitions w Studs 16" oc Named ranges cannot have spaces, or most importantly, special characters like ". So, the range is named the following: PartitionswStuds16oc To change the former into a reference to the latter in the worksheet, I can handle removing the spaces with the following formula: =SUBSTITUTE(B1," ","") I cannot, however, substitute the " because the

Dynamic cell access

亡梦爱人 提交于 2019-12-06 17:14:03
问题 My question may seem quite simple but I haven't found the answer yet. In excel, I would like to access a cell with a dynamic row number. Example 1 : cell A(1+2) Example 2 : cell B(ROW(A1)*10) What is the syntax for this ? Thanks. 回答1: Use the INDIRECT function: =INDIRECT("A" & (1+2)) =INDIRECT("B" & ROW(A1)*10) 回答2: If by cell B(ROW(A1)*10) you meant if A1 was 3 then return the value in B30 ,ie B(3*10) then you want =INDIRECT("B" &A1*10) =INDIRECT("B" & ROW(A1)*10) will always return cell B10