Consulting

Results 1 to 8 of 8

Thread: Formula help for counting indexed cells?

  1. #1

    Formula help for counting indexed cells?

    two tables,tabel a:
    index name product
    1 x x
    2 u u
    table b:
    index property map content
    1 1 1 2
    2 2 1 3
    3 1 2 2
    question1:records in table a is connected with records in table b through the segement map(map in table b directs table a's index),for the example,the first record in table a connects withs the first two records in table b,the second record in table connects with the third record in table b,now i want to count the number of records in table a on condition that the property of any record in table b which is connected with the records in table a is 1,then the record in table a is counted.through this algorithm,the result of the question is 2,how to write the excel function .
    question 2:from the first record to the last record in table a,i want to sum up the content of all the records in table b connected with the record in table a ,the result of the question is :the first record in table a:3+2=5
    the second record in table b:2
    how to write the excel formula,
    hurry ,please help me!

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    dabenxiang12 please look at this link with regards to your title and look at this link with regards your subject matter as we cannot help directly with homework or assignment questions!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Also when you cross post you should supply the link however in this case it probably doesn't matter as we don't (well i don't) speak Chinese!
    cross post
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  4. #4
    what you said is right, but this is not homework or assignment ,in fact ,table a and b are complicated tables ,I just want to simplify the expression of the matter that should be resolved .
    I also tried nearly all the excel functions to resolve the question ,but maybe I am not familiar with excel ,I still can't find the solution ,so I came here for help.
    by the way ,i am not a student .

    if somebody carefully reads the question ,it will find this is a challenging question,because the first row in table a connects the first two rows in table b, the scecond row in table a connects the third row in table b. but nearly all the excel functions process retrieve like the following way: table a 1st row->table b 1st row
    table a 2nd row->table b 2nd row(table a 2nd row should connects table b 3rd row).
    I know how to resolve the question through programs ,but i don't know how to write the excel functions
    Last edited by dabenxiang12; 05-18-2008 at 03:56 PM.

  5. #5
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    You probably need to use SumProduct something like:
    =IF(SUMPRODUCT(--(A1:B1000=A1),--(Sheet2!A1:B1000=1))=0,"",SUMPRODUCT(--(A1:B1000=A1),--(Sheet2!A1:B1000=1)))
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    The only way that I can get the results that OP gets is with

    =SUMIF($C$6:$C$8,A1,$D$6:$D$8)

    but it is so poorly explained I wouldn't get that from the description.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    I know Bob i was having great trouble deciphering what was needed, and i don't really have the formula skills, the sumproduct i was lamely tying to use was to try and count rows that 1 appeared in as per part of the Op's question, however it seems as though he's trying to explain a kind of cascade calculation but it's inconsistent as 1st row is dependant on two rows in another sheet yet 2nd row is only dependant on 1 row, he says its a complicated table and i'm sure it is if it has no real structure or pattern to it!
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Yes it is difficult to see why row 2 is added to the 1s and row 3 is added to the 2s.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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