Date Manipulation to output the same date - excel

Good day!
Using Excel and would like to multiply a date by a value to create new a row with the same date
Example;
before
Column A
27-OCT-19
execution
Column A Column b
27-OCT-19 X 4
output
Column A
27-OCT-19
27-OCT-19
27-OCT-19
27-OCT-19
I've looked around and it seems that people use Visual Basic - However, I can't use Visual Basic due to permission issues on my network.

If your first date begins in cell A2 then enter this formula in cell B2:
=MID(REPT(TEXT(A2," dd-mmm-yy"),4),2,99)
Now copy the formula downward as far as you need.
Based on your revised question, the following should work.
With your reference date in cell A2 and your multiply value in cell B2 enter this formula in cell A3:
=IF((ROW()-ROW($A$2))<$B$2,$A$2,"")
Now copy the formula downward as far as you need.

If you have Excel O365 with the SEQUENCE function, you can use:
A3: =TRIM(MID(SUBSTITUTE(REPT(TEXT($A$2,"dd-mmm-yy "),B2)," ",REPT(" ",99)),IF(SEQUENCE(B2)=1,1,(SEQUENCE(B2)-1)*99),99))
and the results will SPILL down as far as required.

Related

Auto +6 increment while dragging cells in excel

So, I got an excel with two sheets: Sheet1 and Sheet2, in which I transfer data from the first to the second using the formula: =IF(INT(+INDIRECT("Sheet1!A1"))< 42900,0,+INDIRECT("Sheet2!A1")) (the cells are custom format dd/mm/yyyy hh/mm/ss). In Sheet1, the cells are organized in groups made out of 6 columns (in this example, A being the first column within the group).
In Sheet2, when I drag the cell containing said formula to the cell on the right, the formula remains the same. I want so that when I drag the cell, A1 will become G1, basically incrementing the column "number" by 6 jumping to the next group of 6 columns.
Is there a way of doing this WITHOUT using any coding. I need to avoid coding at all costs in order to avoid further complications.
P.S. I apologize if my explanation and title are somewhat vague.
Enter below formula anywhere in Column 1 and drag/copy across (to right)
=IF(INT(INDIRECT("Sheet1!" & ADDRESS(1,FLOOR((COLUMN()-1)*6,1)+1)))< 42900,0,INDIRECT("Sheet1!" & ADDRESS(1,FLOOR((COLUMN()-1)*6,1)+1)))
This formula will refer to cells $A$1,$G$1,$M$1,$S$1,.....
If you have to use this formula in say Column B then change (COLUMN()-1) to (COLUMN()-2) and likewise for Column C,D,E,.... use (COLUMN()-3),(COLUMN()-4),(COLUMN()-5),.... respectively.

Excel measuring arithmetical average (counting blank cells)

I have a problem in Excel. I'm making a program to monitor the consumption of fuel per month. As I do not tank fuel every day, but only every couple days I'd like the program to measure aritchmetic mean for me.
This means it would take the last input and count all blank cells above (excluding my previous input) and measure the mean of fuel consumption in these days.
Example of how it should work:
[link to image] http://i64.tinypic.com/2dre87m.jpg
Edit: If anybody knows how to count number of empty cells between 2 inputs it would also suffice to me.
I was able to get your desired results using an array formula. Assuming your headings Day,Fuel, and Average are in cells A1, B1, and C1 respectively; copy and paste the following formula in cell C2 hit CTRL+SHIFT+ENTER and drag the formula down your column.
=IFERROR(IF(B2="","",(B2/(LARGE(IFERROR(MATCH($B$2:B2,$B$2:B2,0),""),1)-LARGE(IFERROR(MATCH($B$2:B2,$B$2:B2,0),""),2)))),B2)
It gave me a "formula omits adjacent cells" error, but we want to omit the cells below the target row on purpose, so just ignore the error. Hope this helps.
Try this formula:
=IF(B2="","",ABS(B2/(MATCH(0,B$2:B2,-1)-SUM(MATCH(0,B1:B$2,-1)))))
in C2 and copy down.
if cells in column B can contain string values then you can use this formula:
=IF(ISNUMBER(B2),ABS(B2/(MATCH(0,B$2:B2,-1)-SUM(MATCH(0,B1:B$2,-1)))),"")

Formula to Search for Data in One Column, then Apply Formula

I am working on a personal budget sheet in excel, and it's formatted based on my pay dates, to provide more drilled-down information. I have attached an example of it below for reference.
I would like to put a formula into J2, J3, and J4 which will take the data in cells C9:C26 and H9:H16, match it to the date in cells D2:D4, then subtract the expenses in D9:D26 and I9:I16 from E2, E3, and E4.
As you can see, I have just individually summed the cells; however, I would like a formula to be able to adjust as I change the value in cells C9:C26 and H9:H16.
I have found that I can do it with ONE cell, but not multiple or a range. This is the formula I used, and I cannot find a way to make it apply to the entire range of cells: =IF(C14=D3,E3-D14)
I've also tried: =IF(C9:C25=D3,E3-D9:D25) -- I know this formula doesn't work and why. I cannot figure out how to get column C to correspond with column D.
The Budget Sheet
You just need to use SumIf().
In cell J2, put this formula: =SumIf($C$9:$C$25,$I2,$D$9:$D$25)+SumIf($H$9:$H$25,$I2,$I$9:$I$25) and drag down the three cells.
With that, you can add E2-[formula] to subtract all that from E2. Or of course, just do e2-J2 instead. I think that should do what you're looking for. If it's not quite it, let me know and I can tweak.
If you plan to have more than 1 criteria go with SUMIFS
Yes, with S

Find cells less than todays date VBA

I am trying to create a form which will find any cell with a date value less than todays date within a single column and return the row number. I am trying to use the Match function but only receive errors.
Anybody have any idea where to start with this?
Cheers
James
Ok.
Yes this can be done differently by using VBA, but if you don't know VBA it will be hard. You might be able to use excel formulas like this and this may give you what you need.
If you dates are in column A and start in A1.
Add this formula to B2 and copy it down into the other cells in the column.
=IF(A1<TODAY(),ROW(A1),"After")
This is a starting point.
I don't know what you are using the form for. eg what if many dates are before today, do you just take the first one?
ie
Add this to C1
=IF(B1<>"After",1,0)
Add this to C2 and copy down
=IF(B2<>"After",C1+1,C1)
Add this to D1
=IF(C1<>0,A1,"")
Add this to D2 and copy down
=IF(AND(C2<>0,C1=0),A2,"")
Add this to cell E1
=SUM(D:D)
Chnage column D and E to have date format.
Cell E1 now gives you the first date in the list less than today.
Harvey

Excel formula with times in 1904 date system

In Excel I have three columns, say A, B and C, all with the background format of hh:mm:ss and the 1904 date system, meaning that I can do simple arithmetic across the columns.
Cells in columns A and B will mostly be populated with times but can also be either blank or have text in them.
Using cells A1, B1 and C1 as an example I need a formula in C1 which says if both A1 and B1 have times within them then perform the sum A1 minus B1 into C1. So if A1 is 01:07:26 and B1 is 01:08:26 the resultant sum in C1 will be -00:01:00. If blank or text appears in A1 and/or B1 then the arithmetic function will not be performed.
I have been going round in circles with SUMIFS and have not managed to figure out a formula which will do the trick so if anyone could help me I would be very grateful.
I don't have Excel on this machine, but a more fruitful approach would
be something like:
=IF(AND(ISNUM(A1),ISNUM(A2)),A1-B1,"")
If you need more fine-grained checking for a time, see this post.

Resources