Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 94
  • Last Modified:

another Excel formula

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
Jagwarman
Asked:
Jagwarman
  • 2
1 Solution
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
If E2 is text, then

=IF(AND(ISERROR(SEARCH("SAT",E2)),ISERROR(SEARCH("SUN",E2))),1,2)
0
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
If E2 is a date, then

=IF(OR(WEEKDAY(E2)=7,WEEKDAY(E2)=1),2,1)
0
 
Rgonzo1971Commented:
Hi,

Shorter

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

Regards
0
 
JagwarmanAuthor Commented:
Brilliant thanks Phillip
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now