+ Reply to Thread
Results 1 to 8 of 8

question with if statement

  1. #1
    Registered User
    Join Date
    07-20-2007
    Posts
    9

    question with if statement

    guys,

    i want a function that goes down every row and looks at two columns...if the condition in both those columns are true, i want to increment a count. i have the following...

    Please Login or Register  to view this content.
    I want to make the if statement so that it says:

    Please Login or Register  to view this content.
    Can I do this? I don't know the proper formatting for the if statement.

    Also, if I want to define 'Rng' myself as being for example:

    C2:last row containing text

    how would i code that?

    Thanks!

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Your If statement looks fine. What happens when you try it?

    Please Login or Register  to view this content.
    is the last cell in column A that contains something. Does that help with the second question?

  3. #3
    Registered User
    Join Date
    07-20-2007
    Posts
    9
    that if statement gives me a "Then or GoTo" error on the colon of the 'B:B'

    should i try:

    If Sheet1!(Rng) = "Assigned" And Sheet1!(Rng1) = Archives Then

    Thanks!

    when i do that... on the Sheet1! i get a type-declaration character does not match declared data type
    Last edited by behrk2; 07-22-2007 at 06:56 PM.

  4. #4
    Registered User
    Join Date
    07-20-2007
    Posts
    9
    this compiles but i get a circular reference error:


    Please Login or Register  to view this content.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Sorry, my bad. I was looking more at the VB than what you were trying to do with it. This shows one way to see if "File Restore" is in column B.
    Please Login or Register  to view this content.
    here is another
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-20-2007
    Posts
    9
    thats great, thanks. so how can i look for file restore in column B AND "assigned" in column c?

  7. #7
    Registered User
    Join Date
    07-20-2007
    Posts
    9
    ah im sorry, im looking to count the items that match the conditions in both column b and c, not just find the first appearance

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    A SUMPRODUCT function should do what you want. I'm not real good at those, so searching on SUMPRODUCT Conditions should get you a faster answer than waiting for me to figure the syntax.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1