Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
al al is offline
external usenet poster
 
Posts: 363
Default IF clause for a range of cells

The following formula works well for me but is there a way to make it shorter
by defining a range of cells, rather than individual cells, in the IF part?

=SUM(G8:AJ8)+IF(G8="",4)+IF(H8="",4)+IF(I8="",4)+I F(J8="",4)+IF(K8="",4)+IF(L8="",4)+IF(M8="",4)+IF( N8="",4)+IF(O8="",4)+IF(P8="",4)+IF(Q8="",4)+IF(R8 ="",4)+IF(S8="",4)+IF(T8="",4)+IF(U8="",4)+IF(V8=" ",4)+IF(W8="",4)+IF(X8="",4)+IF(Y8="",4)+IF(Z8="", 4)+IF(AA8="",4)+IF(AB8="",4)+IF(AC8="",4)+IF(AD8=" ",4)+IF(AE8="",4)+IF(AF8="",4)+IF(AG8="",4)+IF(AH8 ="",4)+IF(AI8="",4)+IF(AJ8="",4)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default IF clause for a range of cells

Try this array* formula:

=SUM(IF(G8:AJ8="",4,G8:AJ8))

* An array formula must be committed using the key combination of Ctrl-
Shift-Enter (CSE) rather than the usual <Enter. If you do this
correctly then Excel will display curly braces { } around the formula
when viewed in the formula bar - do not type these yourself. If you
edit or amend the formula you will need to use CSE again.

Hope this helps.

Pete

On Jan 18, 12:21*pm, Al wrote:
The following formula works well for me but is there a way to make it shorter
by defining a range of cells, rather than individual cells, in the IF part?

=SUM(G8:AJ8)+IF(G8="",4)+IF(H8="",4)+IF(I8="",4)+I F(J8="",4)+IF(K8="",4)+IF*(L8="",4)+IF(M8="",4)+IF (N8="",4)+IF(O8="",4)+IF(P8="",4)+IF(Q8="",4)+IF(R 8*="",4)+IF(S8="",4)+IF(T8="",4)+IF(U8="",4)+IF(V8 ="",4)+IF(W8="",4)+IF(X8=""*,4)+IF(Y8="",4)+IF(Z8= "",4)+IF(AA8="",4)+IF(AB8="",4)+IF(AC8="",4)+IF(AD 8="*",4)+IF(AE8="",4)+IF(AF8="",4)+IF(AG8="",4)+IF (AH8="",4)+IF(AI8="",4)+IF(AJ*8="",4)


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 563
Default IF clause for a range of cells

Non-array formulas
=SUM(G8:AJ8)+COUNTIF(G8:AJ8,"")*4
or
=SUM(G8:AJ8)+COUNTBLANK(G8:AJ8)*4
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Al" wrote in message
...
The following formula works well for me but is there a way to make it
shorter
by defining a range of cells, rather than individual cells, in the IF
part?

=SUM(G8:AJ8)+IF(G8="",4)+IF(H8="",4)+IF(I8="",4)+I F(J8="",4)+IF(K8="",4)+IF(L8="",4)+IF(M8="",4)+IF( N8="",4)+IF(O8="",4)+IF(P8="",4)+IF(Q8="",4)+IF(R8 ="",4)+IF(S8="",4)+IF(T8="",4)+IF(U8="",4)+IF(V8=" ",4)+IF(W8="",4)+IF(X8="",4)+IF(Y8="",4)+IF(Z8="", 4)+IF(AA8="",4)+IF(AB8="",4)+IF(AC8="",4)+IF(AD8=" ",4)+IF(AE8="",4)+IF(AF8="",4)+IF(AG8="",4)+IF(AH8 ="",4)+IF(AI8="",4)+IF(AJ8="",4)


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default IF clause for a range of cells

Try
=SUM(G8:AJ8)+(COUNTIF(G8:AJ8,"")*4)

--
Jacob


"Al" wrote:

The following formula works well for me but is there a way to make it shorter
by defining a range of cells, rather than individual cells, in the IF part?

=SUM(G8:AJ8)+IF(G8="",4)+IF(H8="",4)+IF(I8="",4)+I F(J8="",4)+IF(K8="",4)+IF(L8="",4)+IF(M8="",4)+IF( N8="",4)+IF(O8="",4)+IF(P8="",4)+IF(Q8="",4)+IF(R8 ="",4)+IF(S8="",4)+IF(T8="",4)+IF(U8="",4)+IF(V8=" ",4)+IF(W8="",4)+IF(X8="",4)+IF(Y8="",4)+IF(Z8="", 4)+IF(AA8="",4)+IF(AB8="",4)+IF(AC8="",4)+IF(AD8=" ",4)+IF(AE8="",4)+IF(AF8="",4)+IF(AG8="",4)+IF(AH8 ="",4)+IF(AI8="",4)+IF(AJ8="",4)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PERCENTILE with an IF Clause Zeelotes Excel Worksheet Functions 3 April 19th 23 02:11 PM
Multiple values for LOOKUP? Maybe add IF clause? DataBeth Excel Worksheet Functions 1 April 30th 09 08:34 PM
$ sign in SQL clause in MS Query FredAker Excel Discussion (Misc queries) 1 July 30th 08 10:43 AM
IF Clause dpal Excel Worksheet Functions 8 July 19th 07 07:32 PM
"Between" in an IF clause gavin Excel Discussion (Misc queries) 5 May 2nd 05 09:27 PM


All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"