Jumat, 30 September 2011

Re: [MS_AccessPros] off topic, IF FORMULA with AND, and OR combined

 

Eric

I tried an If formula and fialed so taking Clive's advice, I wrote a function.

Open the code window and insert a standard module. Put this function in it:
Public Function CalcVals(b As Long, d As Long) As String
CalcVals = IIf((b < 95 Or b > 110) And (d < 95 Or d > 110), "Y", "N")

End Function

Then use the function in the cell where you want the y/n. Put this in the cell:
=CalcVals(B1, D1)

Bill

--- In MS_Access_Professionals@yahoogroups.com, Barry White <imtigerwords@...> wrote:
>
> Yep an excel sheet, that is what I am talking about.
>  
> I already email my excel users group too regarding this but have not heard back.
>  
> Eric Lutz
>
>
> ________________________________
> From: Bill Mosca <wrmosca@...>
> To: MS_Access_Professionals@yahoogroups.com
> Sent: Thursday, September 29, 2011 4:21 PM
> Subject: Re: [MS_AccessPros] off topic, IF FORMULA with AND, and OR combined
>
>
>  
> Eric
>
> This method isn't making any sense to me if this is a table. You say "cell". Are you talking about an excel sheet?
>
> Regards,
> Bill Mosca, Founder - MS_Access_Professionals
> http://www.thatlldoit.com
> Microsoft Office Access MVP
> https://mvp.support.microsoft.com/profile/Bill.Mosca
>
> --- In MS_Access_Professionals@yahoogroups.com, Barry White <imtigerwords@> wrote:
> >
> > Hello all,
> >
> > I have a row of numbers, say:
> >
> >   B C D E F G H I
> > 1 112 83 126 94 98 110 67 89
> > 2     start formula in cell D2          
> >  
> > In each cell, for three consecutive cells, I wish to test two conditions, so that in cell D2, the start of my formula, I am testing each cell B1, C1, and D1 for the two conditions that follow:
> >  
> > IF cell B1 is less than 95 OR greater than 110 AND
> > cell C1 is also less than 95 OR greater than 110 AND
> > cell D1 is also less than 95 OR greater than 110, put "Y" for YES or "N" for NO.
> >  
> > So this same logical statement would apply as in E2, however, it would test for the two conditions mentioned above (<95 OR >110) on cells C1, D1, and E1.  Cell F2 would test for the same conditions but on/for cells D1, E1, and F1, etc
> >  
> > What is the syntax for this?  I know the correct logic in terms of words, but I cannot get this syntax to work.
> >  
> > Please help, and Thank you in advance for everyone's contribution.
> >  
> > Eric Lutz
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
> [Non-text portions of this message have been removed]
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar