Solved

another Excel formula

Posted on 2014-11-20
4
72 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

809 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