excel-formula

Finding a straight in a cribbage

耗尽温柔 提交于 2020-07-23 04:01:41
问题 Background For those of you not familiar with Cribbage, it uses a standard 52 card deck with aces being always low. A player's hand consists of 4 cards, and there is 1 turn card that all players can use to help score their hand. So for a little practice problem for myself, I wrote a we bit of VBA and had all ~12.9 million possible scoring combination printed in an excel sheet. I assigned each card an integer 1 to 52 and set it up so that each suit is a sequential block of 13 cards. 1-13 =

How to pass discontinuous range of cells from Excel to ExcelDNA function

一世执手 提交于 2020-07-21 07:43:14
问题 Consider such ExcelDNA function definition: [ExcelFunction(Name = "Fnc1", Description = "Fnc1")] public static object Fnc1( [ExcelArgument(Name = "Arg1", Description = "Arg1", AllowReference = true)] object rng) { // ... } It works fine when called with a single cell like this =Fnc1(A1) or with continuous range of cells like this =Fnc1(A1:A3) . But it doesn't work when called with discontinuous range of cells e.g. =Fnc1(A1,A5,A10) . The error #VALUE! is returned. Is there a way how to call

Increment excel formula by 1

前提是你 提交于 2020-07-21 01:55:21
问题 I'm trying to copy and paste a few cells keeping the format and them ebing linked to a table. Currently i have a table but i am referencing it from another sheet e.g: =Sheet2!A1 =Sheet2!B1 =Sheet2!C1 =Sheet2!D1 =Sheet2!E1 I'm trying to copy it down 4 lines at a time and paste multiple times, the values keep going to the current cell ID but i'm wanting to increment them by 1 each time, e.g. when i paste i would like them to be: =Sheet2!A2 =Sheet2!B2 =Sheet2!C2 =Sheet2!D2 =Sheet2!E2 Is there

Increment excel formula by 1

谁说胖子不能爱 提交于 2020-07-21 01:50:53
问题 I'm trying to copy and paste a few cells keeping the format and them ebing linked to a table. Currently i have a table but i am referencing it from another sheet e.g: =Sheet2!A1 =Sheet2!B1 =Sheet2!C1 =Sheet2!D1 =Sheet2!E1 I'm trying to copy it down 4 lines at a time and paste multiple times, the values keep going to the current cell ID but i'm wanting to increment them by 1 each time, e.g. when i paste i would like them to be: =Sheet2!A2 =Sheet2!B2 =Sheet2!C2 =Sheet2!D2 =Sheet2!E2 Is there

Increment excel formula by 1

跟風遠走 提交于 2020-07-21 01:48:52
问题 I'm trying to copy and paste a few cells keeping the format and them ebing linked to a table. Currently i have a table but i am referencing it from another sheet e.g: =Sheet2!A1 =Sheet2!B1 =Sheet2!C1 =Sheet2!D1 =Sheet2!E1 I'm trying to copy it down 4 lines at a time and paste multiple times, the values keep going to the current cell ID but i'm wanting to increment them by 1 each time, e.g. when i paste i would like them to be: =Sheet2!A2 =Sheet2!B2 =Sheet2!C2 =Sheet2!D2 =Sheet2!E2 Is there

Increment excel formula by 1

大憨熊 提交于 2020-07-21 01:47:53
问题 I'm trying to copy and paste a few cells keeping the format and them ebing linked to a table. Currently i have a table but i am referencing it from another sheet e.g: =Sheet2!A1 =Sheet2!B1 =Sheet2!C1 =Sheet2!D1 =Sheet2!E1 I'm trying to copy it down 4 lines at a time and paste multiple times, the values keep going to the current cell ID but i'm wanting to increment them by 1 each time, e.g. when i paste i would like them to be: =Sheet2!A2 =Sheet2!B2 =Sheet2!C2 =Sheet2!D2 =Sheet2!E2 Is there

Excel Forumula - Adding working hours to date and time

岁酱吖の 提交于 2020-07-20 06:23:47
问题 I am currently using a forumla to add working hours to a start date and time: =WORKDAY(A1,INT(B1/8.5)+IF(TIME(HOUR(A1),MINUTE(A1),SECOND(A1))+TIME(MOD(B1,8.5),MOD(MOD(B1,8.5),1)*60,0)>TIME(17,30,0),1,0),$D$1:$D$21)+IF(TIME(HOUR(A1),MINUTE(A1),SECOND(A1))+TIME(MOD(B1,8.5),MOD(MOD(B1,8.5),1)*60,0)>TIME(17,30,0),TIME(9,0,0)+TIME(HOUR(A1),MINUTE(A1),SECOND(A1))+TIME(MOD(B1,8.5),MOD(MOD(B1,8.5),1)*60,0)-TIME(17,30,0),TIME(HOUR(A1),MINUTE(A1),SECOND(A1))+TIME(MOD(B1,8.5),MOD(MOD(B1,8.5),1)*60,0))

Excel Forumula - Adding working hours to date and time

戏子无情 提交于 2020-07-20 06:23:26
问题 I am currently using a forumla to add working hours to a start date and time: =WORKDAY(A1,INT(B1/8.5)+IF(TIME(HOUR(A1),MINUTE(A1),SECOND(A1))+TIME(MOD(B1,8.5),MOD(MOD(B1,8.5),1)*60,0)>TIME(17,30,0),1,0),$D$1:$D$21)+IF(TIME(HOUR(A1),MINUTE(A1),SECOND(A1))+TIME(MOD(B1,8.5),MOD(MOD(B1,8.5),1)*60,0)>TIME(17,30,0),TIME(9,0,0)+TIME(HOUR(A1),MINUTE(A1),SECOND(A1))+TIME(MOD(B1,8.5),MOD(MOD(B1,8.5),1)*60,0)-TIME(17,30,0),TIME(HOUR(A1),MINUTE(A1),SECOND(A1))+TIME(MOD(B1,8.5),MOD(MOD(B1,8.5),1)*60,0))

Make vba excel function dynamic with the reference cells

旧街凉风 提交于 2020-07-20 03:44:33
问题 I have written a code which creates a sumproduct of two range.... But I want the final answer to change when the reference ranges whose sumproduct is been calculated is changed p = 1 For p = 1 To 12 ActiveSheet.Cells(LastRow + 2, 31 + p).Formula = WorksheetFunction.SumProduct(Range(Cells(3, 31 + p), Cells(LastRow, 31 + p)), Range(Cells(3, 6 + p), Cells(LastRow, 6 + p))) Next p for example in the above sheet the sumproduct result is shown in the lastrow+2 th row and from column 31 to 42, but

Find last non-zero cell's column reference in an UNORDERED range of values

允我心安 提交于 2020-07-19 01:57:48
问题 I have a range with numbers in a row in Excel, say: A B C D E F G H I J K L Line 1 => 0 0 0 3 2 8 3 6 0 0 0 0 All cells are non-blank but some contain zeros and some contain numbers. Also, the range cannot be ordered in either ascending or descending order. I need a formula (not VBA) that will return the column of the last non-zero value in the range (i.e. column 8 for cell H1 above). I can get the actual value of cell H1 with this formula: LOOKUP(2,1/(A1:A10<>0),A1:A10) but I cannot find a