Solved

another Excel formula

Posted on 2014-11-20
4
71 Views
Last Modified: 2014-11-20
Can an Expert help me out with this please.

I need to say

IF E2 Contain either Sat or Sun, return 2 if it does not contain either return 1

thanks
0
Comment
Question by:Jagwarman
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40454791
If E2 is text, then

=IF(AND(ISERROR(SEARCH("SAT",E2)),ISERROR(SEARCH("SUN",E2))),1,2)
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40454793
If E2 is a date, then

=IF(OR(WEEKDAY(E2)=7,WEEKDAY(E2)=1),2,1)
0
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40454799
Hi,

Shorter

=IF(MOD(E2,7)<2,2,1)

Regards
0
 

Author Comment

by:Jagwarman
ID: 40454803
Brilliant thanks Phillip
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel 2016 writing and applying a conditional formula to a cell 10 35
Excel Score Formula 5 47
Excel Conditional Formatting in a Macro 4 25
Filling Blank Cells 14 15
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now