?
Solved

Find Value in a Row in Excel

Posted on 2015-01-12
4
Medium Priority
?
63 Views
Last Modified: 2015-01-12
I have a spreadsheet and need to search a range in each row looking for a value (0). Example: Look in F12:P12 and if a 0 is found in any cell return 0 Else 1.
0
Comment
Question by:EMCIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40544387
Sub DoIt()
For Each cel In Selection
    If cel.Value = "0" Then
        myAnswer = 0
        Exit For
    Else
        myAnswer = 1
    End If
Next
MsgBox myAnswer
End Sub

Open in new window

0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 total points
ID: 40544389
=IF(COUNTIF(F12:P12,0),0,1)
should do it.
0
 
LVL 11

Author Comment

by:EMCIT
ID: 40544409
=IF(COUNTIF(F12:P12,0),0,1) works great. I have another column that needs to search specific columns as well.
Example: G12, I12, J12, M12, N12 only but when I try to string the cells it doesn't work.
0
 
LVL 11

Author Comment

by:EMCIT
ID: 40544441
I got it!

=IF(SUM(G22,I22,J22,M22,N22)=COUNT(G22,I22,J22,M22,N22),1,0)

Thank you for your assistance.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question