[Solved] COUNTIF within an IF

Discuss the spreadsheet application

[Solved] COUNTIF within an IF

Postby keithbakerlv » Fri May 10, 2019 4:04 pm

Hi, I can't figure this formula out.
I want to put =COUNTIF(Sheet1.O17:O206; "=Y") in an IF formula that counts Sheet1.D17:D206 only if the value is "On".

Count how many times "Y" is in the cell range O12:O206 only if the cells in the range D17:D206 have the value On.

So something like =IF(Sheet1.D17:D206 = "On"; COUNTIF(Sheet1.O17:O206; "=Y");""))
Last edited by keithbakerlv on Fri May 10, 2019 7:08 pm, edited 1 time in total.
OpenOffice 4.1.3 on Windows 10 Pro
keithbakerlv
 
Posts: 9
Joined: Fri Mar 10, 2017 12:57 am

Re: COUNTIF within an IF

Postby MrProgrammer » Fri May 10, 2019 4:41 pm

keithbakerlv wrote:Count how many times "Y" is in the cell range O17:O206 only if the cells in the range D17:D206 have the value On.
I believe your goal is: In rows 17 through 206 count how many have "Y" in column O and "On" in column D.
=SUMPRODUCT(O17:O206="Y";D17:D206="On")
SUMPRODUCT tutorial

If you need further assistance attach a document demonstrating the situation (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the document itself). Tell us what the correct answer for your attachment would be.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.5 Build 9789 on MacOS 10.11.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Moderator
 
Posts: 3810
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: [SOLVED] COUNTIF within an IF

Postby keithbakerlv » Fri May 10, 2019 7:09 pm

Thanks! I saw that formula in the wiki but I thought it didn't pertain to me. I see how to works now.
OpenOffice 4.1.3 on Windows 10 Pro
keithbakerlv
 
Posts: 9
Joined: Fri Mar 10, 2017 12:57 am


Return to Calc

Who is online

Users browsing this forum: No registered users and 26 guests