Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"X" in a range returns value in another column

Status
Not open for further replies.

NerdyOne

MIS
Oct 16, 2001
50
US
I need to look in a range of numbers (B14:H14) named "TIPS_ONE" to see if any of the cells have an X in them (used to note that the person worked for tips that day). If any of the days are noted with an X then R14 has a value of $8 in it. The problem is, no matter if they work one day or seven, R14 can only equal $8.

I appreciate anybody's help on this one becuase it really has me scratching my head.
 
You don't need VBA for that. Just put this formula in a cell:
[blue]
Code:
   =SUMPRODUCT(($B$14:$H$14="X")*8)
[/color]

or
[blue]
Code:
   =SUMPRODUCT((TIPS_ONE="X")*8)
[/color]


 
I've tried that, and it works if the person only works one day out of the week, but if you "check off" more than one day in a week it multiplies each day by $8. Any suggestions?
 
Hi NerdyOne,

If you just want $8 regardless of how many X's there are, try this in R14:

{color blue]
Code:
=IF(ISNA(MATCH("X",B14:H14,0)),0,8)
[/color]

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top