+ Reply to Thread
Results 1 to 20 of 20

Find holiday ,sunday and saturday and replace

Hybrid View

  1. #1
    Registered User
    Join Date
    06-23-2010
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    58

    Find holiday ,sunday and saturday and replace

    Hello check this pic http://imgur.com/VEW4khL
    I have all dates from 1 jan 2011 to 31/ dec 2015 in column "B"
    I have holidays in column "F"

    I want a formula to find these holiday dates of column "F" in column "B" and write "2" in adjoining column "C" if there is holiday other wise "1"
    I also want "2" in column "C" if there is sunday or saturday in column "C" dates other wise "1"

    Result I want see pic http://imgur.com/wRAnusN
    check result I want in column "C"
    I want nothing in column "D",I have given this in pic just for illustration

  2. #2
    Registered User
    Join Date
    06-05-2014
    Posts
    13

    Re: Find holiday ,sunday and saturday and replace

    Greetings,
    Using Excel 2013 and based on your example the solution for column C will be as follows:
    =IF(WEEKDAY(a1, 2)>5, "2", "1")

    You could use the same principle to match the Holidays on a nested IF.

    Hope this helps

  3. #3
    Registered User
    Join Date
    06-23-2010
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Find holiday ,sunday and saturday and replace

    thanks this formula works in list in above post but not in this list where dates are random http://imgur.com/TaFKkxJ
    also how can I add formula for holiday ?

  4. #4
    Registered User
    Join Date
    07-04-2014
    Location
    Pune, India
    MS-Off Ver
    2016 & 365
    Posts
    18

    Re: Find holiday ,sunday and saturday and replace

    Dear lightofchaos
    I tried the ans but it didn't work... Sorry i think i didn't able to use the formula properly. So Please upload an example sheet if it is possible it will help us very much....


    Alternatively in column no C this formula can be used =IF(COUNTIF(F:F,B2)=1,2,IF(OR(TEXT(B2,"DDDD")="Sunday",TEXT(B2,"DDDD")="Saturday"),2,1))

    and in column D this formula can be used
    =IF(C2=2,IFERROR(VLOOKUP(B2,I:J,2,FALSE),TEXT(B2,"DDDD")),"")

  5. #5
    Registered User
    Join Date
    07-04-2014
    Location
    Pune, India
    MS-Off Ver
    2016 & 365
    Posts
    18

    Re: Find holiday ,sunday and saturday and replace

    Dear lightofchaos
    I tried the ans but it didn't work... Sorry i think i didn't able to use the formula properly. So Please upload an example sheet if it is possible it will help us very much....


    Alternatively in column no C this formula can be used =IF(COUNTIF(F:F,B2)=1,2,IF(OR(TEXT(B2,"DDDD")="Sunday",TEXT(B2,"DDDD")="Saturday"),2,1))

    and in column D this formula can be used
    =IF(C2=2,IFERROR(VLOOKUP(B2,I:J,2,FALSE),TEXT(B2,"DDDD")),"")

  6. #6
    Registered User
    Join Date
    06-05-2014
    Posts
    13

    Re: Find holiday ,sunday and saturday and replace

    Greetings $hivasopa,

    Could you please step me through the upload process as I'm fairly new to this.

    Thank you,

    Using the above formulas you will get the following result.
    1/1/2015 Thursday 1 1/3/2015
    1/2/2015 Friday 1 1/10/2015
    1/3/2015 Saturday 2 2 1/26/2015
    1/4/2015 Sunday 2
    1/5/2015 Monday 1
    1/6/2015 Tuesday 1
    1/7/2015 Wednesday 1
    1/8/2015 Thursday 1
    1/9/2015 Friday 1
    1/10/2015 Saturday 2 2
    1/11/2015 Sunday 2
    1/12/2015 Monday 1
    1/13/2015 Tuesday 1
    1/14/2015 Wednesday 1
    1/15/2015 Thursday 1
    1/16/2015 Friday 1
    1/17/2015 Saturday 2
    1/18/2015 Sunday 2
    1/19/2015 Monday 1
    1/20/2015 Tuesday 1
    1/21/2015 Wednesday 1
    1/22/2015 Thursday 1
    1/23/2015 Friday 1
    1/24/2015 Saturday 2
    1/25/2015 Sunday 2
    1/26/2015 Monday 1 2
    1/27/2015 Tuesday 1
    1/28/2015 Wednesday 1
    1/29/2015 Thursday 1
    1/30/2015 Friday 1

  7. #7
    Registered User
    Join Date
    06-23-2010
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Find holiday ,sunday and saturday and replace

    thanks both
    lightofchaos use goadvance for uploading attachment
    $shivasopa I want "2" for holidays and sunday ,friday not the text

  8. #8
    Registered User
    Join Date
    07-04-2014
    Location
    Pune, India
    MS-Off Ver
    2016 & 365
    Posts
    18

    Re: Find holiday ,sunday and saturday and replace

    I am uploading the file with alternative answers use the formula as per your requirement

    i think it will help you kevin....
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-23-2010
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Find holiday ,sunday and saturday and replace

    Quote Originally Posted by $hivasopa View Post
    I am uploading the file with alternative answers use the formula as per your requirement

    i think it will help you kevin....
    thanks $hivasopa ,but this file do not give "2" for sunday and holiday
    I want "2" for sunday,saturday and holiday else "1"

  10. #10
    Registered User
    Join Date
    06-05-2014
    Posts
    13

    Re: Find holiday ,sunday and saturday and replace

    Quote Originally Posted by kavin View Post
    thanks both
    lightofchaos use goadvance for uploading attachment
    $shivasopa I want "2" for holidays and sunday ,friday not the text
    Thanks for the feedback. Here is the attached example
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-23-2010
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Find holiday ,sunday and saturday and replace

    Quote Originally Posted by lightofchaos View Post
    Thanks for the feedback. Here is the attached example
    thanks lightofchaos ,this is what I want ,but I want both result in column "C"

  12. #12
    Registered User
    Join Date
    06-23-2010
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Find holiday ,sunday and saturday and replace

    Quote Originally Posted by kavin View Post
    Hello check this pic http://imgur.com/VEW4khL
    I have all dates from 1 jan 2011 to 31/ dec 2015 in column "B"
    I have holidays in column "F"

    I want a formula to find these holiday dates of column "F" in column "B" and write "2" in adjoining column "C" if there is holiday other wise "1"
    I also want "2" in column "C" if there is sunday or saturday in column "C" dates other wise "1"

    Result I want see pic http://imgur.com/wRAnusN
    check result I want in column "C"
    I want nothing in column "D",I have given this in pic just for illustration
    check attached sheet

  13. #13
    Registered User
    Join Date
    07-04-2014
    Location
    Pune, India
    MS-Off Ver
    2016 & 365
    Posts
    18

    Re: Find holiday ,sunday and saturday and replace

    Kavin use this formula i think it will help you
    =IF(COUNTIF(F:F,$B2)=1,VLOOKUP($B2,F:G,2,FALSE),IF(OR(TEXT($B2,"DDDD")="Saturday",TEXT($B2,"DDDD")="Sunday"),TEXT($B2,"DDDD"),""))
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    06-05-2014
    Posts
    13

    Re: Find holiday ,sunday and saturday and replace

    Greetings,
    For the second part of the question (Holidays). You need to have a point of reference. You could use the If statement with Match, using the same criteria (F column as point of reference)as follows:

    =IF(MATCH(A1,$F$1:$F$3, 0), "2"," ")

    Hope this helps.

  15. #15
    Registered User
    Join Date
    06-05-2014
    Posts
    13

    Re: Find holiday ,sunday and saturday and replace

    Greetings,

    From earlier example the following formula will do the trick (Please note I've only used three holidays as an example from column F.

    =IFERROR(IF(MATCH(A3,$F$1:$F$3, 0), "2"," "), "")

    Hope this works.

  16. #16
    Registered User
    Join Date
    06-23-2010
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Find holiday ,sunday and saturday and replace

    Quote Originally Posted by kavin View Post
    Hello check this pic http://imgur.com/VEW4khL
    I have all dates from 1 jan 2011 to 31/ dec 2015 in column "B"
    I have holidays in column "F"

    I want a formula to find these holiday dates of column "F" in column "B" and write "2" in adjoining column "C" if there is holiday other wise "1"
    I also want "2" in column "C" if there is sunday or saturday in column "C" dates other wise "1"

    Result I want see pic http://imgur.com/wRAnusN
    check result I want in column "C"
    I want nothing in column "D",I have given this in pic just for illustration
    check attached sheet
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    07-04-2014
    Location
    Pune, India
    MS-Off Ver
    2016 & 365
    Posts
    18

    Re: Find holiday ,sunday and saturday and replace

    best reply lightofchaos
    but the que make it very typical even it is very easy...
    Thanks

  18. #18
    Registered User
    Join Date
    06-05-2014
    Posts
    13

    Re: Find holiday ,sunday and saturday and replace

    Greetings,
    You will need to nest the if statements as follows:

    =IF(WEEKDAY(B1, 2)>5, "2", IFERROR(IF(MATCH(B1,$G$1:$G$3, 0), "2"," "), "1"))


    Hope this helps, and thank you for the upload tip!
    Attached Files Attached Files
    Last edited by lightofchaos; 06-14-2015 at 01:38 PM.

  19. #19
    Registered User
    Join Date
    06-23-2010
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Find holiday ,sunday and saturday and replace

    thanks this solves

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Locate Saturday and Sunday
    By boldcode in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2015, 01:33 PM
  2. [SOLVED] Exclude Sunday and Pub holiday
    By Frazzle6 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-23-2014, 07:02 PM
  3. Exclude Sunday and Pub holiday
    By Frazzle6 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-23-2014, 12:12 AM
  4. Saturday, Sunday or Holiday BY-PASS
    By GPErtel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-19-2013, 08:26 PM
  5. Find how many date between two dates but excluding Sunday and holiday
    By tantcu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2013, 05:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1