Excel (if statement, maybe?) Birthday List or Vlookup - excel

Hello I am trying to use a simple excel sheet (last name, first name, date of birth, date of hire) for an employee listing to then create a list of birthdays (pro[bably +/- 7 days) - just the last & first name. Secondly the same thing for the hire date (probably +/- 14 days) and the years of service, that calculation I figured out easily.
I was trying to do this with if statements or datedif and am struggling.
maybe this isnt the proper tool, any thoughts, suggestions would be greatly appreciated!
Please see sample data screen shot below:
expected output:
Maybe this would be better as a vlookup?
Thank you

OK, so here is what I came up with based on my understanding of the question:
=IF(OR(DATEDIF(B2,TODAY(),"YD")<=7,DATEDIF(B2,TODAY(),"YD")>=359),A2,"NO")
The formula here takes number of days between the birthday and today (ignoring the years) and checks if they're less than or equal to 7 or more than or equal to 359.
Sample spreadsheet: https://www.dropbox.com/s/kxgi9eeoikems66/Birthday.xlsx?dl=0

Insert two more columns for month of birth and month of hiring. Add the following formula in both consecutively
=TEXT(C1,”MMMM”) and =TEXT(D1,”MMMM”)
The final sheet will look like this
After that select all of your data and insert Pivot table and format it like the below
You will get an auto updatable sheet without any macros and extra work

Related

Salary Calculation in Excel

So I have a problem that I'm dealing with for days now and I cant figure it out. I have this problem in excel, I am looking for assistance regarding a calculation. I want to be able to calculate a payment date schedule based on a set monthly payment date but to exclude exclude weekends and specific holiday dates e.g.
Here's My file I'm Working on:[].
Here is some function that I already used : =IF(TEXT(O2,"dddd")=$U$2,O2+2,IF(TEXT(O2,"dddd")=$U$3,O2+1,O2))This works for only weekends, It doesn't work on holidays, I want it to work not only on weekends and on holidays too.
Thanks in advance.
This can be done by using the WORKDAY() function together with the DATE() function.
B2 contains year - 2012
B3 contains payment day - 28
A5:A17 contain payment periods (month numbers) - 1..12
D6:D16 contain holidays
=WORKDAY(DATE($B$2,A6,$B$3-1),1,$D$6:$D$14)
Also see the linked image. (NB: My Excel version uses semi-colon ";" in stead of comma "," to separate arguments in functions.)
Best of luck!
Xharx
Image of the Excel sheet solution
Here's How u Do it. First we have to have starting month from where were gonna start counting I made this formula which works great, =WORKDAY(EDATE($B$15,COUNT($B$15:B17))-1,1,holiday1)
were freezing the starting date and counting how many rows are we from the starting position , then were gonna minus 1 from it , and in days were gonna type 1, if there's holidays that I wanna exclude too I just can enter it and give it a name, (Some of u who doesn't understand this, its just saying that its referring to specified cells which we named holidays) and it works flawlessly.
B15 = starting month

How can I perform a conditional indirect sum in excel with an if function?

Sample Sheet
Profit
Sales
Expenses
COGS
Hello, I have an array of financial data that I need to turn into profit. I have been able to successfully sum all of the financial together based on a specific date range, but I have encountered a problem with cost of goods sold. Using the match function (apologies if the format is ridiculous, I am new to stackoverflow; the formula is present in the google sheet as well):
=SUM(INDIRECT("'Sales'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Sales!$1:$1,0),4),1,"") &MATCH(A3,Sales!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)))+SUM(INDIRECT("'Expenses'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Expenses!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Expenses!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)))+SUM(INDIRECT("'COGS'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,COGS!$1:$1,0),4),1,"")&MATCH(A3,COGS!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,COGS!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)))
I can sum every value on every sheet by row when matching a list of IDs which is constant throughout all data sheets. My problem is: I only want to sum the cost of goods sold sheet to profit ONLY If there is a corresponding sales value in the same location but on the sales tab. Ive tried replacing the sum with sumif to no avail, as I am just getting the hang of this indirect functions. Can anyone provide me with any information that may help me better understand this problem I'd really appreciate it. Thanks
I think that the COGS was meant to be a one time expense per day. That is how all but the first example are calculated.
If so, I believe the correct answer is:
{=SUM(INDIRECT("'Sales'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)))+SUM(INDIRECT("'Expenses'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Expenses!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Expenses!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)))+SUMPRODUCT(IFERROR(INDIRECT("'Sales'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0))/INDIRECT("'Sales'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)),0),INDIRECT("'COGS'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,COGS!$1:$1,0),4),1,"")&MATCH(A3,COGS!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,COGS!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)))}
Without more info I can only come up with that.
=SUM(Sales!B2:I2)+SUM(Expenses!B2:I2)-SUMPRODUCT((Sales!B2:I2<>0)*(COGS!B2:I2))
or
=SUMPRODUCT((Sales!B2:I2)*($C$1<=Sales!B1:I1)*($E$1>=Sales!B1:I1))+SUMPRODUCT((Expenses!B2:I2)*($C$1<=Expenses!B1:I1)*($E$1>=Expenses!B1:I1))-SUMPRODUCT((Sales!B2:I2<>0)*(COGS!B2:I2)*($C$1<=COGS!B1:I1)*($E$1>=COGS!B1:I1))
if dates matters
With the sheet you provided it returns 3.2
Why did you used so much indirect & substitute?
Was it required or fixed ranged fits your need ?

SUMPRODUCT several ifs

I´ve spent a lot of time with a formula in Excel and I´m still blocked. I hope you can help me.
I have a table in Excel with several values as shown in this
screenshot.
What I´m trying to extract is the number of Fruits sold in a specific month. That is, how many lemons were sold in January 2016, for example. This is the formula I´m using:
=SUMPRODUCT((B3:B38=E4)*(MONTH($A$3:$A$150)=12)*(YEAR($A$3:$A$150)=2015);$C$3:$C$150)
But the result is #N/A as seen in the screenshot.
What Am I doing wrong? Any help, please?
Thanks a lot in advance!
You can use arrays in excel to get this answer
{SUM(IF(MONTH(F$3&"1")=MONTH($A$3:$A$150),IF($E4=$B$3:$B$150,$C$3:$C$150,0),0))}
You can use this Sumproduct formula which uses array logic:
SUMPRODUCT((MONTH($A$3:$A$38)=MONTH(TEXT(G$2,"MMM")&1))*($C$3:$C$38=$F4)*
($D$3:$D$38))
Sumproduct Demo
Part of your problem is your ranges are not equal in length. B3:B38 has to be the same number of rows as $A$3:$A$150 and C3:C150. When rows are not equal things blow up on you.
=SUMPRODUCT(($B$3:$B$150=$E4)*(MONTH($A$3:$A$150)=12)*(YEAR($A$3:$A$150)=2015);$C$3:$C$150)
if you change your header row to be actual excel date format, and then change the cell display format to just show the month (as suggested by csanjose), then you can adjust your sumproduct formula as follows and copy to all cells in your table.
=SUMPRODUCT(($B$3:$B$38=$E4)*(MONTH($A$3:$A$150)=Month(F$3))*(YEAR($A$3:$A$150)=Year(F$3));$C$3:$C$150)
Fill your month-row with the last day of each month, then apply date format to show only month name.
The formula you should use is, for example, in g8:
=SUMIFS($C:$C;$B:$B;$E8;$A:$A;"<="&G$3;$A:$A;">"&F$3)
First column "F" doesn't have a column on the left to compare, so you can put a date in E3 or change a bit the formula (example of F8):
=SUMIFS($C:$C;$B:$B;$E8;$A:$A;"<="&F$3;$A:$A;">2015/12/31")
Take a look at the result
If you don't want to use a pivot table, you can use this formula to get what you need:
=SUMPRODUCT(($B$3:$B$150=$E3)*(MONTH($A$3:$A$150)=1)*(YEAR($A$3:$A$150)=2015)*$C$3:$C$150)
Then drag-fill the cell to copy it to every month column (just make sure you change the month number in the formula (and year if you're doing that too)), and then drag-fill down the columns.
That should work pretty food good :)
Good Luck!

Count amount of entries within one year and other criteria

For my Pilots logbook I am trying to be able to make a easy search where you can enter certain criteria and get the amount of landings and time in flight.
For example you could enter the departing airport and it would give you the amount of takeoffs from that airport.
So far I have been able to get the results using the COUNTIFSfunction.
Trying to add a field, where you can enter a year and it would only count the occurrences in that year is giving me a hard time!
The date is in the following format: dd.mm.yyyy. The year to search for would be entered in a cell (yyyy).
Just adding it to the COUNTIFSobviously doesn't work. I know I can get the year out of the date using the YEARfunction, yet I can't figure out a way of including this into the COUNTIF.
Any Ideas?
CODE:
=COUNTIFS(Logbook!F3:F2000,IF(ISBLANK(B30),"*",B30),Logbook!C3:C2000,IF(ISBLANK(C30),"*",C30),Logbook!K3:K2000,IF(ISBLANK(D30),"*",D30),Logbook!L3:L2000,IF(ISBLANK(E30),"*",E30),Logbook!G3:G2000,IF(ISBLANK(F30),"*",F30),Logbook!B2:B2000,B30)
Where B30 is the cell with the year, and B2:B2000 being the cells with the dates.
I also tried to compare by the text (somewhat like RIGHT(Logbook!B2:B2000,4)=B30) but it doesn't do anything but returning a #VALUE error.
Seems like a really good case for PivotTables and slicers... You could even avoid the RIGHT() formula if you format the dates; then you could use the built-in group feature of PivotTables.

Get weeknumber by date

I have several dates in a spreadsheet:
I would like to get the weeknumber in the column B for the date in column C in european time.
I tried something like that(and also that above):
= MID(TEXT(C2,"dd.m.yyyy"), 3, 2)
However that only gives me .2 in the B column...
Any suggestions on how to implement/start that?
I really appreciate your answer!
PS.: I also added excel tags because its similar to google spreadsheet. There is probably a chance that I can implement something from excel in google spreadsheet
in excel for get week number use
=WEEKNUM(C2)
Use the following formula
WeekDay(c2)
It will return the week day number.

Resources