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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
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 :laugh: )

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:

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][/tr]
[tr][td]
1​
[/td][td]
Name​
[/td][td]
DoB​
[/td][td]
Next B'day​
[/td][td]
[/td][/tr]

[tr][td]
2​
[/td][td]Wade[/td][td]
24 Dec 1979​
[/td][td]
24 Dec 2014​
[/td][td]C2: =EDATE(B2, 12*(DATEDIF(B2+1, TODAY(), "y") + 1))[/td][/tr]

[tr][td]
3​
[/td][td]Rene[/td][td]
30 Dec 1965​
[/td][td]
30 Dec 2014​
[/td][td][/td][/tr]

[tr][td]
4​
[/td][td]Otto[/td][td]
01 Jan 1993​
[/td][td]
01 Jan 2015​
[/td][td][/td][/tr]

[tr][td]
5​
[/td][td]Jane[/td][td]
04 Jan 1976​
[/td][td]
04 Jan 2015​
[/td][td][/td][/tr]

[tr][td]
6​
[/td][td]Hana[/td][td]
14 Jan 1955​
[/td][td]
14 Jan 2015​
[/td][td][/td][/tr]

[tr][td]
7​
[/td][td]Alan[/td][td]
16 Jan 1972​
[/td][td]
16 Jan 2015​
[/td][td][/td][/tr]

[tr][td]
8​
[/td][td]Kent[/td][td]
23 Jan 1966​
[/td][td]
23 Jan 2015​
[/td][td][/td][/tr]

[tr][td]
9​
[/td][td]Dana[/td][td]
06 Feb 1982​
[/td][td]
06 Feb 2015​
[/td][td][/td][/tr]

[tr][td]
10​
[/td][td]Eric[/td][td]
14 Feb 1954​
[/td][td]
14 Feb 2015​
[/td][td][/td][/tr]

[tr][td]
11​
[/td][td]Mark[/td][td]
08 Mar 1982​
[/td][td]
08 Mar 2015​
[/td][td][/td][/tr]

[tr][td]
12​
[/td][td]Tina[/td][td]
19 Mar 1990​
[/td][td]
19 Mar 2015​
[/td][td][/td][/tr]

[tr][td]
13​
[/td][td]Ivan[/td][td]
23 Mar 1990​
[/td][td]
23 Mar 2015​
[/td][td][/td][/tr]

[tr][td]
14​
[/td][td]Fran[/td][td]
08 Apr 1963​
[/td][td]
08 Apr 2015​
[/td][td][/td][/tr]

[tr][td]
15​
[/td][td]Nina[/td][td]
13 Apr 1991​
[/td][td]
13 Apr 2015​
[/td][td][/td][/tr]

[tr][td]
16​
[/td][td]Yuri[/td][td]
20 Apr 1960​
[/td][td]
20 Apr 2015​
[/td][td][/td][/tr]

[tr][td]
17​
[/td][td]Gary[/td][td]
22 Apr 1974​
[/td][td]
22 Apr 2015​
[/td][td][/td][/tr]

[tr][td]
18​
[/td][td]Zuni[/td][td]
08 May 1961​
[/td][td]
08 May 2015​
[/td][td][/td][/tr]

[tr][td]
19​
[/td][td]Leah[/td][td]
10 Jun 1986​
[/td][td]
10 Jun 2015​
[/td][td][/td][/tr]

[tr][td]
20​
[/td][td]Peri[/td][td]
30 Jun 1961​
[/td][td]
30 Jun 2015​
[/td][td][/td][/tr]

[tr][td]
21​
[/td][td]Quin[/td][td]
18 Jul 1979​
[/td][td]
18 Jul 2015​
[/td][td][/td][/tr]

[tr][td]
22​
[/td][td]Barb[/td][td]
22 Jul 1986​
[/td][td]
22 Jul 2015​
[/td][td][/td][/tr]

[tr][td]
23​
[/td][td]Cain[/td][td]
01 Aug 1976​
[/td][td]
01 Aug 2015​
[/td][td][/td][/tr]

[tr][td]
24​
[/td][td]Ulis[/td][td]
09 Aug 1973​
[/td][td]
09 Aug 2015​
[/td][td][/td][/tr]

[tr][td]
25​
[/td][td]Vera[/td][td]
01 Sep 1958​
[/td][td]
01 Sep 2015​
[/td][td][/td][/tr]

[tr][td]
26​
[/td][td]Xana[/td][td]
29 Oct 1986​
[/td][td]
29 Oct 2015​
[/td][td][/td][/tr]

[tr][td]
27​
[/td][td]Seth[/td][td]
14 Nov 1957​
[/td][td]
14 Nov 2015​
[/td][td][/td][/tr]
[/table]


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,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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