Not able to solve this Spreadsheet Function, Pls Help

intradayteam

New Member
Joined
Feb 15, 2010
Messages
29
Using Google Spreadsheet I want to add a Upcoming Birthday Event Sheet to my website ( I heard that i am allowed to display (embedd) particular cells on any webpage)


Here are the conditions i wish to solve.


Suppose A1 to A1000 have a list of names & B1 to B1000 have dates (birth dates in dd/mm/yyyy format)


Names & Birthdays from current date to the upcoming 15 days should be sorted in C1 to C15.


If anyones or more than one's birthday is on current date its name should be displayed in D1 to Dn (n is number of birthdays on that particular day, it can be more than one or two). It doesnt matters if all the names be displayed in D1 with commas.

Here i am guessing that C1:C15 & D1 to Dn will update automatically as they will be given formulas according to dates and date changes everyday.


Actually i want to add iframe or widget to my website which can wish Happy Birthday to the users having birthday on current date and display Birthdays of users for upcoming 15 days. (i have the list of names and birthdays with me).


Here is the sample just for an idea....


Happy Birthday "User1" "User2" (this should be in D1)

Upcoming Birthdays (its just a heading of column C)

"Name" - "Date"

"Name" - "Date"
"Name" - "Date"
"Name" - "Date"

"Name" - "Date"


these "Name" - "Date" should be automatically sorted in order to upcoming 15 days from current date. For example if today's date is 01/11/2014 (dd/mm/yyyy) then D1 should display names of user(s) having birthday on current date and C1 to C15 should display names of users having birthday in next (upcoming) 15 days.


I tried my best to explain my query, Anyone can help with the formula (function) !!!


Pls do mention the cell address where i can paste the particular fuction. i.e put this function in D1.


Thanks a lot.
 
Hey intradayteam,

I am listening as I have it set up that when anyone posts a reply to a subscribed thread that it sends me a notification to my email. Unfortunately my hours have been tied up due to RL right now. I will take a look again tomorrow. For now here is one item.

for #2 you should be able to just wrap an if statement around it like this for D6:
Code:
=if(iferror("Happy Birthday to "&join(", ",filter(A:A,month(B:B)=month( E2),day(B:B)=day(E2))))=0,"No Member's Birthday Today",iferror("Happy Birthday to "&join(", ",filter(A:A,month(B:B)=month( E2),day(B:B)=day(E2)))))

later

Ty
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hey intradayteam,

So, based on the array formula in D11, what should the value be?

Also, can you explain what the array formula does in steps so that I can deconstruct it to determine what needs to be done in order to fix it?

After looking at your Google page I can see how it would be better to list 15 users versus 15 days because then you would have to do some more formulas, but based on the fact that it appears that you will be having a great quantity of users you may consider it just the same. Unless of course you will just show one days worth of birthdays only and do not plan to have any warning as to up-coming birthdays?


Also, what is the function of the value in Cell E9?

later

Ty
 
Last edited:
Upvote 0
Thanks Tyron,

Here is the formula in D11
Code:
[LEFT][COLOR=#000000][FONT=arial]=ArrayFormula(substitute(trim(transpose(split(concatenate({(if(unique(ArrayFormula(filter(TEXT(B:B,"dd/mm"),date(0,month(B:B),day(B:B))>date(0,month(E2),day(E2)),date(0,month(B:B),day(B:B))<=date(0,month(E2),day(E2)+E9))))=transpose(ArrayFormula(filter(TEXT(B:B,"dd/mm"),date(0,month(B:B),day(B:B))>date(0,month(E2),day(E2)),date(0,month(B:B),day(B:B))<=date(0,month(E2),day(E2)+E9)))),transpose((query({A:A,text(B:B,"dd/mm")},"select  Col1 where '"&join(",  ",unique((filter(TEXT(B:B,"dd/mm"),date(0,month(B:B),day(B:B))>date(0,month(E2),day(E2)),date(0,month(B:B),day(B:B))<=date(0,month(E2),day(E2)+E9)))))&"'  contains Col2")) ),))&"  ",transpose(split(rept(Char(10)&char(9),countunique((filter(TEXT(B:B,"dd/mm"),date(0,month(B:B),day(B:B))>date(0,month(E2),day(E2)),date(0,month(B:B),day(B:B))<=date(0,month(E2),day(E2)+E9))))),char(9)))}),char(10)))),"  ",", ")&" -  "&unique((filter(TEXT(B:B,"dd/mm"),date(0,month(B:B),day(B:B))>date(0,month(E2),day(E2)),date(0,month(B:B),day(B:B))<=date(0,month(E2),day(E2)+E9)))))[/FONT][/COLOR][/LEFT]

Let me explain everything once again (i will try my level best, no sleep since last 24 hours, lots of work)

A2 to A2000 has names & B2 to B2000 has birthdates (i have this names and birthdates data with me, i will put it manually one by one or i can publish a spreadsheet form online for my users). So No formulas here in column A & B.

D2 - this cell has no formula, but we can input date here (this is just for checking sake, so whenever my sheet gets its final formula, i can check it with any date i wish)

E2 - this cell has formula, it checks if D2 has some date, if yes then it pulls d2 data, if d2 is empty, it shows current date by this formula
Code:
[LEFT][COLOR=#000000][FONT=arial]=if(D2="",today(),D2)[/FONT][/COLOR][/LEFT]

D6 - this cell has formula, it checks the whole list of dates in B2 to B2000 or can say whole column B, if any date matches with E2 (which is current date, or the date written by me in D2) then it pulls out name(s) of that user(s) and shows it with commas. For example if value in E2 is 16-11-2014 then D6 formula check this date with full column B, if it finds any match, it pulls the name in same row of column A and shows it here. Formula for D6 is

Code:
[LEFT][COLOR=#000000][FONT=arial]=iferror("Happy Birthday to "&join(", ",filter(A:A,month(B:B)=month( E2),day(B:B)=day(E2))))[/FONT][/COLOR][/LEFT]

But now, i have updated this formula with the one given by you, So now updated/rectified formula for D6 is...

Code:
=if(iferror("Happy Birthday to "&join(", ",filter(A:A,month(B:B)=month( E2),day(B:B)=day(E2))))=0,"No Member's Birthday Today",iferror("Happy Birthday to "&join(", ",filter(A:A,month(B:B)=month( E2),day(B:B)=day(E2)))))</pre>

E9 - This cell has no formula, its there just to put some figure (number of days) which can be used in formula of D11. For example if we enter number "15" in cell E9, then the formula in D11 will sort list of 15 users upcoming birthdates (from current date or from date entered in D2). For example if D2 is empty, E2 will show current date, say its 16-11-2014, If we put number 7 in E9 then D11 formula searches for users/birth dates having birthday in upcoming 7 days and display list of users with dates in D11.

15 is really a large number, i am happy with 7 or 10. And yes, my idea about changing this to 15 users instead of 15 days wasnt a good idea. Let it remain as it is... infact i will reduce it to 7 days.

Now here comes the MONSTER :)

D11 - This cell has formula, infact most important formula for this sheet (which is currently not perfect).

Say if E2 has a date of 16-11-2014 & E9 has number 7. Then D11 formula should check/search next 7 days dates in column B and if it finds any match, it should pull username from same row (from column A) and should display something like this

17/11 - user3, user888, user 75. (these user's birthday is on 17/11, which is next day from current date (upcoming day))
18/11 - user22, user975, user 666, user 1091 (these user's have birthday on 18/11, which is day after tomorrow from current date.
20/11 - user99 (only one user birthday on 20/11, and no birthdays on 19/11

Above list can go till maximum 7 rows or less, because i have given range of 7 days in cell E9.

Now, One guy helped me in D11 formula, but formula is not complete, it has some errors, and this is the last pending thing. So the formula for D11 is

Code:
[LEFT][COLOR=#000000][FONT=arial]=ArrayFormula(substitute(trim(transpose(split(concatenate({(if(unique(ArrayFormula(filter(TEXT(B:B,"dd/mm"),date(0,month(B:B),day(B:B))>date(0,month(E2),day(E2)),date(0,month(B:B),day(B:B))<=date(0,month(E2),day(E2)+E9))))=transpose(ArrayFormula(filter(TEXT(B:B,"dd/mm"),date(0,month(B:B),day(B:B))>date(0,month(E2),day(E2)),date(0,month(B:B),day(B:B))<=date(0,month(E2),day(E2)+E9)))),transpose((query({A:A,text(B:B,"dd/mm")},"select  Col1 where '"&join(",  ",unique((filter(TEXT(B:B,"dd/mm"),date(0,month(B:B),day(B:B))>date(0,month(E2),day(E2)),date(0,month(B:B),day(B:B))<=date(0,month(E2),day(E2)+E9)))))&"'  contains Col2")) ),))&"  ",transpose(split(rept(Char(10)&char(9),countunique((filter(TEXT(B:B,"dd/mm"),date(0,month(B:B),day(B:B))>date(0,month(E2),day(E2)),date(0,month(B:B),day(B:B))<=date(0,month(E2),day(E2)+E9))))),char(9)))}),char(10)))),"  ",", ")&" -  "&unique((filter(TEXT(B:B,"dd/mm"),date(0,month(B:B),day(B:B))>date(0,month(E2),day(E2)),date(0,month(B:B),day(B:B))<=date(0,month(E2),day(E2)+E9)))))[/FONT][/COLOR][/LEFT]

Above formula has some errors, it doesnt works if we enter year ending dates like 31-12-2014 in D2 and range of 7 days in E9. Pls fix this so it can show upcoming birthdays of users having birthday in upcoming 7 days (January)

Another error I found was, if we enter dates like 29-02-2014, D11 says #N/A why so ! All other dates are working fine, then why animosity with february last day.

Check it live, Pls feel free to check and edit this sheet, (This is just a sample copy, its not original, so feel free to edit)

2 more things i wish to change,

1. D11 should show date first and names afterwards (instead of names first and dates afterwards)
Like This

Code:
[COLOR=#222222][FONT=Arial]15-04 - user1, user2
[/FONT][/COLOR][COLOR=#222222][FONT=Arial]21-04 - user3, user4
[/FONT][/COLOR][COLOR=#222222][FONT=Arial]27-04 - user11, user6[/FONT][/COLOR], user88, user509

and not like this

Code:
[COLOR=#222222][FONT=Arial]user1, user2 - 15-04
[/FONT][/COLOR][COLOR=#222222][FONT=Arial]user3, user4 - 21-04
[/FONT][/COLOR][COLOR=#222222][FONT=Arial]user11, user6[/FONT][/COLOR], user88, user509 - 27-04

I think this will be easy for you, just changing positions (though i dont know, how to do it :LOL: )

2.
Dates in cell D11 are not in order, Pls fix this. it should be like this
Code:
[COLOR=#222222][FONT=Arial]
15-04 - user1, user2
[/FONT][/COLOR][COLOR=#222222][FONT=Arial]21-04 - user3, user4
[/FONT][/COLOR][COLOR=#222222][FONT=Arial]27-04 - user11, user6[/FONT][/COLOR], user88, user509

and not like this

Code:
[COLOR=#222222][FONT=Arial]
21-04 - user3, user4
[COLOR=#222222][FONT=Arial]15-04 - user1, user2
[COLOR=#222222][FONT=Arial]27-04 - user11, user6[/FONT][/COLOR], user88, user509
[/FONT][/COLOR][/FONT][/COLOR]

Query & Explanation over.

Few suggestions (ideas) coming in my mind:
#2 would be easy i think, By anyway if we can sort column B by dates (ascending) (or by pulling and sorting it to column C). As far as i can understand, i think YEAR has no role in any formula, formula works only on mm and dd, so why not to sort only dd/mm in column C and then pull it to D11 formula. Well this is just a guess :)

Thanks for all your time and efforts.

Waiting ....
 
Upvote 0
Hey intradayteam,

Yeah, definitely you should rest a bit if you can. The coffee is starting to show. However, I got a significant explanation that should help.

In regards to 29-02-????: The reason this may not be working is because not every february has 29 days in it. This could be causing an issue and may need a modification to check for leap years. (another pain in the butt. lol).

Possible solution for the date-name instead of names-date would be to use a seperate column for the date. I will have to check it out. Broke down and signed up so I can start working on google sheets. lol.

Will continue to work on it.

later

Ty
 
Upvote 0
A simpler alternative, perhaps:

Row\Col
A​
B​
C​
D​
1​
Name​
DoB​
Next B'day​
2​
Wade
24 Dec 1979​
24 Dec 2014​
C2: =EDATE(B2, 12*(DATEDIF(B2+1, TODAY(), "y") + 1))
3​
Rene
30 Dec 1965​
30 Dec 2014​
4​
Otto
01 Jan 1993​
01 Jan 2015​
5​
Jane
04 Jan 1976​
04 Jan 2015​
6​
Hana
14 Jan 1955​
14 Jan 2015​
7​
Alan
16 Jan 1972​
16 Jan 2015​
8​
Kent
23 Jan 1966​
23 Jan 2015​
9​
Dana
06 Feb 1982​
06 Feb 2015​
10​
Eric
14 Feb 1954​
14 Feb 2015​
11​
Mark
08 Mar 1982​
08 Mar 2015​
12​
Tina
19 Mar 1990​
19 Mar 2015​
13​
Ivan
23 Mar 1990​
23 Mar 2015​
14​
Fran
08 Apr 1963​
08 Apr 2015​
15​
Nina
13 Apr 1991​
13 Apr 2015​
16​
Yuri
20 Apr 1960​
20 Apr 2015​
17​
Gary
22 Apr 1974​
22 Apr 2015​
18​
Zuni
08 May 1961​
08 May 2015​
19​
Leah
10 Jun 1986​
10 Jun 2015​
20​
Peri
30 Jun 1961​
30 Jun 2015​
21​
Quin
18 Jul 1979​
18 Jul 2015​
22​
Barb
22 Jul 1986​
22 Jul 2015​
23​
Cain
01 Aug 1976​
01 Aug 2015​
24​
Ulis
09 Aug 1973​
09 Aug 2015​
25​
Vera
01 Sep 1958​
01 Sep 2015​
26​
Xana
29 Oct 1986​
29 Oct 2015​
27​
Seth
14 Nov 1957​
14 Nov 2015​

Sort by col C.
 
Upvote 0
I wonder if microsoft excel web app has same features like google spreadsheet !!!!
i.e. publishing sheet online, publishing only particular cells on a webpage (by using iframe), Autorepublish whenever changes are made.

If the answer is yes then why cant we use excel web app instead of google spreadsheet, getting formula for excel webapp must be easy in this forum i suppose :).

Any suggestions or update ?
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,393
Members
449,446
Latest member
CodeCybear

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top