IF AND OR functions

R

Rondia

I have looked everywhere for help. This should be a simple formula,
but never works for me. I have a main worksheet that I entered dated
data into. I want another spreadsheet to pull data specific to my
criteria. Basically I'm trying to pull If Cell A:1 is greater than or
equal to cell: B:2 and cell A:1 is less than or equal to Cell B:3 then
true.

It's dates that I am working with. If this date is >= 8/4/06 and is <=
8/11/06 then true.

I can't get it to work... I would love love love any help someone can
offer.

Thanks in advance :)

Rondia
 
G

Guest

=if(or(a1>=b2,a1<=b3),true,false)

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Rondia" escreveu:
 
D

Dav

Cell A:1 is greater than or
equal to cell: B:2 and cell A:1 is less than or equal to Cell B:3 then
true.

Its not entirely clear what you want but
and(a1>=b2,a1<=b3) is what you require but you may need to put th
other sheet names in the formula

or maybe if(and(a1>=b2,a1<=b3),a1,"")

Regards

Da
 
R

Rondia

I really appreciate everyone's help - still not working :(

Here's more detail:

Sheet 1: Cell A1:A2500 (date column ranging from 8/1/06-8/31/06)
Sheet 2: Cell D1 (a specific date 8/4/06)
Sheet 2: Cell D2 (a specific date 8/11/06)
Sheet 2: Cell A8 (this is the first of cells that I want a formula
that will give me the data from Sheet 1 Cell A1:A2500 if the date in
that cell is >= 8/4/06 (Sheet 2: Cell D1) AND <=8/11/06 (Sheet 2: Cell
D2)

I then have 5 additional columns I want brought over if the data in
Column A matches the criteria requested.

Thanks :)
Rondia
 
B

Bearacade

I think I know what you need.

How comfortable are you with Macros?

I can set one up for you that will filter out what you want, copy those
rows and bring over to the second sheet.

If my understanding is correct. In Sheet1, you have 2500 rows of data,
and in A1 is that date of these data. and you want it to be filtered out
so that only rows that are within certain dates gets copied over to
sheet2.

This can be easily accomplished with a Macro.

If that is indeed what you need, go ahead and tell me and I will whip
one up for you. I do need to know what 5 column other columns you need
and if those are the only 5 columns with data.
 
R

Rondia

Oh thank you Bearacade!!

very comfortable with macros - didn't even think of that... You are
correct. I have a main spreadsheet of data - I need to pull the rows
of data over for lines that fall in the specific requested dates. The
dates will change each week. I do billing thru each Friday....

What do you have in mind?

Thank you :):)
Rondia
 
R

Rondia

Oops forgot to give you the info. you needed....

I am currently using Columns A - H. Each week the dates will change
that I need to pull out.
I do the billing on Salt Water Disposals. I enter data from tickets
then pull the week I need into an invoice separate & then export it to
a pdf for a more professional looking invoice. I currently have one
well but really need to tighten up my formulas & process b/c I will
have 8-10 wells by end of year. It currently takes 8-10 hours a week
on this well the way I am currently doing it... I then pull the data
by truck & date into a supplemental sheet just as a courtesy to the
trucking company for their billing benefit. Then I pull the data into
another sheet for Railroad Commission reporting (by lease). So I pull
data by date for invoicing, by truck & date for supplemental reporting
& by lease for RRC reporting...

I know you didn't want all of that. If you can help me with the first
macro - I may be able to figure out working the other 2 I need....

Thank you again....
Rondia
 
R

Rondia

Oops forgot to give you the info. you needed....

I am currently using Columns A - H. Each week the dates will change
that I need to pull out.
I do the billing on Salt Water Disposals. I enter data from tickets
then pull the week I need into an invoice separate & then export it to
a pdf for a more professional looking invoice. I currently have one
well but really need to tighten up my formulas & process b/c I will
have 8-10 wells by end of year. It currently takes 8-10 hours a week
on this well the way I am currently doing it... I then pull the data
by truck & date into a supplemental sheet just as a courtesy to the
trucking company for their billing benefit. Then I pull the data into
another sheet for Railroad Commission reporting (by lease). So I pull
data by date for invoicing, by truck & date for supplemental reporting
& by lease for RRC reporting...

I know you didn't want all of that. If you can help me with the first
macro - I may be able to figure out working the other 2 I need....

Thank you again....
Rondia
 
B

Bearacade

This is what I have worked out.. you will have to tweak it a bit.

The basis is this, the dates are in Sheet1!A and Sheet1!B:F has the
rest of the data (and assuming that there are no other data), it
actually doesn't matter cause this will pull the entire row out. If
you need to pull specific columns, tell me.

It will take the date from Sheet2!D1 and Sheet2!D2 to apply the filter

and it will starts Pasting in Sheet2!A8

Sub Macro2()

Sheets("Sheet1").Select
Cells.Select
Selection.AutoFilter Field:=1, Criteria1:=">=" &
Range("Sheet2!D1").Value, Operator:=xlAnd, Criteria2:="<=" &
Range("Sheet2!D2").Value
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Sheet2").Select
Range("A7").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Selection.AutoFilter
Range("A1").Select

End Sub
 
B

Bearacade

This is what I have worked out.. you will have to tweak it a bit.

The basis is this, the dates are in Sheet1!A and Sheet1!B:F has the
rest of the data (and assuming that there are no other data), it
actually doesn't matter cause this will pull the entire row out. If
you need to pull specific columns, tell me.

It will take the date from Sheet2!D1 and Sheet2!D2 to apply the filter

and it will starts Pasting in Sheet2!A8

Sub Macro2()

Sheets("Sheet1").Select
Cells.Select
Selection.AutoFilter Field:=1, Criteria1:=">=" &
Range("Sheet2!D1").Value, Operator:=xlAnd, Criteria2:="<=" &
Range("Sheet2!D2").Value
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Sheet2").Select
Range("A7").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Selection.AutoFilter
Range("A1").Select

End Sub
 
R

Rondia

Thank you so much!! I guess I'm not as comfortable as I thought with
macro's. I edited your macro to fit my sheets names & cells correctly
- not working.... I feel terrible you're taking the time to help me &
I didn't give you what you needed from the start.

Better example:
I have a sheet 'August Tickets Log' that I enter all tickets in for
that month.
I have a second sheet 'Matthew's - August' that pulls over all Matthews
tickets.
I have another sheet "Marsh - August' that pulls over all Marsh
tickets, and so forth.
And then, I have a sheet 'Matthew's 08-2006-Invoice' that I use to pull
that weeks' tickets for Matthew's from the 'Matthew's - August' sheet.
And the same for all the other trucking entities.

My goal was to have a sheet in the front with button commands: 'Enter
tickets' to take me to the main sheet; 'Matthew's Invoice' pulling that
weeks tickets for Matthew's... etc. [week 1, week 2, etc.]

I'm probably making this more complicated than it needs to be, but I
want to be prepared as I take on more leases. I've looked up functions
and researched books - I can't seem to make anything work with the
dates.

I don't blame you if you don't reply again, but if you do - thank
you...

Thanks,
Rondia
 
R

Rondia

Thank you so much!! I guess I'm not as comfortable as I thought with
macro's. I edited your macro to fit my sheets names & cells correctly
- not working.... I feel terrible you're taking the time to help me &
I didn't give you what you needed from the start.

Better example:
I have a sheet 'August Tickets Log' that I enter all tickets in for
that month.
I have a second sheet 'Matthew's - August' that pulls over all Matthews
tickets.
I have another sheet "Marsh - August' that pulls over all Marsh
tickets, and so forth.
And then, I have a sheet 'Matthew's 08-2006-Invoice' that I use to pull
that weeks' tickets for Matthew's from the 'Matthew's - August' sheet.
And the same for all the other trucking entities.

My goal was to have a sheet in the front with button commands: 'Enter
tickets' to take me to the main sheet; 'Matthew's Invoice' pulling that
weeks tickets for Matthew's... etc. [week 1, week 2, etc.]

I'm probably making this more complicated than it needs to be, but I
want to be prepared as I take on more leases. I've looked up functions
and researched books - I can't seem to make anything work with the
dates.

I don't blame you if you don't reply again, but if you do - thank
you...

Thanks,
Rondia
 
B

Bearacade

How exactly are tickets entered into August Tickets Log.

Better question is, how exactly do you distincts Matthew's ticket to
Marsh's tickets?

Is there a column that has their names in it?

How many columns total are there in the inital log? I am guessing 9...
=)
 
B

Bearacade

How exactly are tickets entered into August Tickets Log.

Better question is, how exactly do you distincts Matthew's ticket to
Marsh's tickets?

Is there a column that has their names in it?

How many columns total are there in the inital log? I am guessing 9...
=)
 
R

Rondia

There is a sheet 'August Ticket Log' - A:3 Header is 'Truck Co.', B:3
Header is 'Operator', C:3 = 'Lease, D:3 = 'Date', E:3 = 'Ticket #', F:3
= 'Truck #', G:3 = 'BBLS', H:3 = 'Type', J:3 = 'Amount' (I:3 is
skipped).

I begin entering data on A:4.

I want to insert a sheet that has control buttons: 1 - Enter tickets,
2 - Invoice Matthews Week 1, Week 2, Week 3, etc. and then one for
each trucking co., then a button for supplemental by truck #, and last
one for supplemental by lease.

Unless you might have a better way?

You are so nice for taking so much time with me.... Really I do
appreciate it. I have looked for an advanced excel book, but haven't
found one I like yet. Do you recommend any? I can pick one up this
w/e.

Thanks,
Rondia
 
R

Rondia

There is a sheet 'August Ticket Log' - A:3 Header is 'Truck Co.', B:3
Header is 'Operator', C:3 = 'Lease, D:3 = 'Date', E:3 = 'Ticket #', F:3
= 'Truck #', G:3 = 'BBLS', H:3 = 'Type', J:3 = 'Amount' (I:3 is
skipped).

I begin entering data on A:4.

I want to insert a sheet that has control buttons: 1 - Enter tickets,
2 - Invoice Matthews Week 1, Week 2, Week 3, etc. and then one for
each trucking co., then a button for supplemental by truck #, and last
one for supplemental by lease.

Unless you might have a better way?

You are so nice for taking so much time with me.... Really I do
appreciate it. I have looked for an advanced excel book, but haven't
found one I like yet. Do you recommend any? I can pick one up this
w/e.

Thanks,
Rondia
 
B

Bearacade

I am heading to a meeting right now.. I will work on this a bit mor
when I come back.. but I do have some ideas I will share with you
 
B

Bearacade

I am heading to a meeting right now.. I will work on this a bit mor
when I come back.. but I do have some ideas I will share with you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top