Avatar of macentrap
macentrapFlag for Australia

asked on 

Nested IF statement to compare values in 3 columns

Hi Experts

Would like to implement using IF statement or VBA

If there is value is zero for 2009, 2010,2011 then not used in "3yrs"
if any of them is true would like  years' in which used .
IF used in all three years then "High Usage"

or suggestion to bett
data.xls
Microsoft Excel

Avatar of undefined
Last Comment
Ingeborg Hawighorst (Microsoft MVP / EE MVE)
ASKER CERTIFIED SOLUTION
Avatar of redmondb
redmondb
Flag of Afghanistan image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of neothwin
neothwin

here is the formula for row two.
=IF(SUM(C2:E2)>0,IF(C2*D2*E2>0,"High Usage","USED "&IF(C2>0,$C$1,"")& " " &IF(D2>0,$D$1,"")& " " &IF(E2>0,$E$1,"")),"No Usage 3yrs")
Avatar of macentrap
macentrap
Flag of Australia image

ASKER

Thank You
Avatar of redmondb
redmondb
Flag of Afghanistan image

neothwin - the extra code in my solution was to provide commas and avoid extra spaces!
Avatar of redmondb
redmondb
Flag of Afghanistan image

Thanks, macentrap!
I realise this question is closed, but for the record:

Both

IF(AND(C2<>0,D2<>0,E2<>0)

and

IF(C2*D2*E2>0

can also be expressed with

IF(Countif(C2:E2,">0")

The benefit is speed. It's only one operation as opposed to three comparisons or two multiplications.

cheers, teylyn
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo