Countifs Function for Criteria 1 in Column Criteria 2 in Row

nawdrizzy

New Member
Joined
Aug 13, 2018
Messages
18
Hi,

I'm hoping that there's a way to do this.

I'm trying to do a countifs formula where one of the criteria is in the column and from that column the data that I want to count is in that row.

So basically something like Countif(A:A,name,D1:AI,"LE"). I've attached an image of the sheet that I'm working on. Any help will be greatly appreciated
 

Attachments

  • Capture.PNG
    Capture.PNG
    67.9 KB · Views: 9

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I dont understand a thing, since there is no Rows Column in the picture, a Result example of what you need would help.

Try this? =COUNTIF(B3:D3,B1)

I dont know if I really understood.

Traductor de Formulas - copia - copia.xlsm
ABCDEF
1Criteria1Criteria2
2Laura1
3Laura2Criteria1Criteria2Criteria12Counts Criteria1 forLaura2
4
5Laura3Criteria1
6Laura5Criteria1Criteria1Criteria21Counts Criteria2 forLaura5
7
8Laura4
Team 2
Cell Formulas
RangeFormula
E3E3=COUNTIF(B3:D3,B1)
E6E6=COUNTIF(B6:D6,C1)
 
Upvote 0
So i'm trying to take the value "Parts-17000.1" and add it to a second sheet then I want to run a count formula and count how many "LE" there is in row 4 for "Parts-17000.1". I've attached a new image to help clarify
 

Attachments

  • Capture.PNG
    Capture.PNG
    42.8 KB · Views: 4
Upvote 0
So you want to have in Sheet2 2 columns,
Column A: Employee name
Column B: the LE count, a number.

Am I right?
 
Upvote 0
Then its simple create a second worksheet, in column A copy the names, in column B use the formula I gave you before.

Example for the first name, "A4": (note that 'sheet1' is an example a placeholder, you have to actually put your sheet name in its place)
Put this in B4 in Sheet2 =COUNTIF('sheet1'!$D4:$AI4,'sheet1'!$AA$1)

then drag it down until B30 or whatever namy names you have.

If it doesnt work try this =COUNTIF('sheet1'!$D4:$AI4,"LE")

Let me know how it goes.
 
Upvote 0
The second formula would work if I only had one First name. Since I have multiple names I want have a dynamic formula that can count the "LE" for each name. The image i uploaded shows D1 as the name. I want to have E3 to count all the "LE" in D4:AI4 in the date sheet.
 

Attachments

  • Capture.PNG
    Capture.PNG
    23.2 KB · Views: 2
Upvote 0
Ok, so assuming your picture in message #1 is sheet1, and your picture in message #7 is sheet2.

This code looks the name of D1 sheet2 (Name4), in Sheet1 and obtains the possition of the row of that name.
Then it counts how many times "LE" appears in that row.

Look at this Example.
Sheet1
Traductor de Formulas - copia - copia.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJ
1
2
3
4Name1LE
5Name2LELELE
6Name3LELE
7Name4LELELELE
8Name5
9Name6
10Name7
11Name8
12
sheet1

Sheet2
Traductor de Formulas - copia - copia.xlsm
BCDEF
1Name4
2
34<----- counts the number of "LE" in D1 (Name4)
4
sheetcount
Cell Formulas
RangeFormula
D3D3=COUNTIF(OFFSET(sheet1!D1,MATCH(D1,sheet1!A1:A11,)-1,0,1,31),"LE")


Summing up, this is the formula you need to use in your D3 cell in your sheet2, =COUNTIF(OFFSET(sheet1!D1,MATCH(D1,sheet1!A1:A11,)-1,0,1,31),"LE")
Things you have to modify in the formula: highlited in bold.
  • sheet1 for your actual sheet1 name.
  • "LE" if you want to count other thing than "LE", or make it dynamic having the "LE" text in other cell.
  • 11 , my sample data only had 8 names, from A1 to A11, yours should be bigger so change that 11 for a bigger number that includes all your name rows, for example 30.
ALSO, you should enter the formula with CRTL SHIFT ENTER to avoid problems.

Let me know if you have any trouble.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,540
Messages
6,120,107
Members
448,945
Latest member
Vmanchoppy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top