Pergunta

I have a spreadsheet with 2 worksheets in it. In the first worksheet, it is a task list which has a couple columns such as phone number, location, etc. However, it has rows going down which corresponds to different types of materials [steel, sugar, metal and more (and a lot these repeat too)]. These materials are in Column D; there a total of 1102 rows. The column I am interested is in Column I. In this column, I have used conditional formatting to validate the cells in the columns with the following rules: If 1 is inserted, the cell is gray. If 2 is inserted, the cell turns yellow. If 3 is inserted, the cell turns green (the reason it's like this is because Column I is a "status" column as I've named it which will allow me to keep track if the status is completed or not).

Then, we move over to the second worksheet which I am using to track different metrics. What I am trying to do is, I have a column C in worksheet 2 which is all my "completed" items. Hence, anytime a 3 (green) was inserted into the Column I on the first worksheet, I want it to increment the count automatically by +1 here in the second worksheet with the associated material. However, there might be 10 different entries of STEEL for instance that are green (3). So in the second worksheet, for STEEL it should list 10 completed.

Quick Ex:

MATERIALS STATUS
STEEL 3 [would be green]
STEEL 3 [would be green]
SUGAR 3 [would be green]

So in worksheet 2:
MATERIALS COMPLETED
STEEL 2 [two here because it found that 2 steel were marked 3/green]
SUGAR 1

I hope this makes sense. I am trying to do more conditional formatting on the second worksheet to create my own formula to do this, but for some reason, I am thinking it has to be done with a macro. Any help would be much appreciated! Thank you very much.

P.S. I've been trying to use this INDIRECT formula and I think this may also be able to do it. But I can't figure out the formula. I know the logic:

IF COLUMN I in WORKSHEET 1 contains 3, then increment +1 in COLUMN C in WORKSHEET 2.

However, I don't know how to incorporate the rows into this and group together the count if it's 10 STEELS for instance.

Foi útil?

Solução

As per the comments on the question itself, here is a solution. This particular formula makes the following assumptions:

  • The item name (STEEL, etc.) is in column D on the first sheet (mentioned in the question)
  • The item's count (=2, =3, etc.) is on column I of the first sheet (also specified in the question)
  • The first sheet is called 'Sheet1'
  • The item name is in column B on the second sheet
  • This particular formula is placed in cell C2 on the second sheet

=COUNTIFS(Sheet1!I:I, "=3", Sheet1!D:D, B2)

To explain briefly how it works - it's testing for two conditions: the "=3" in column I (as needed per the question), and the item name on Sheet2 matching the item name on Sheet1 (which does the grouping by item name, as requested). This formula can then be copied using Auto-Fill to as many rows (still in column C on the second sheet) as needed.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top