Solved

Excel Formula - VLOOKUP with Count

Posted on 2013-12-06
2
1,357 Views
Last Modified: 2013-12-06
I have the following formula in a cell, which will display either 'Y' or 'N' (possibly '')

=IF(OR($H288 = "", $H288 = "Monthly Totals:"), "", IF(ISERROR(VLOOKUP($H288,DecemberPayees,1,FALSE)), "N","Y"))

I use it as part of my 'check ledger' to make sure I've accounted for a recurring payee. If I've created an entry in the range 'DecemberPayees' (which changes monthly), a 'Y' will be displayed. In some cases, I make bi-weekly payments, which means that I really don't want to display 'Y' unless there are at least 2 (yes, I know there can sometimes be 3 pay periods in a month, if you figure out how to determine that and adjust the formula accordingly, I'll figure out some way to give you extra points).

Basically, for biweekly payments, the VLOOKUP needs to find 2 occurrences of the payment in the named range.
0
Comment
Question by:dbbishop
[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 Comments
 
LVL 35

Accepted Solution

by:
mvidas earned 500 total points
ID: 39701737
Hi dbb,

Since you're not using the return value of vlookup, why not use COUNTIF instead?

=IF(OR($H288 = "", $H288 = "Monthly Totals:"), "", IF(COUNTIF(DecemberPayees,$H288)=1, "N","Y"))

Change the =2 to test for 2, etc. If you want to see if its there at least one, then do >0 instead of =1.

Matt
0
 
LVL 15

Author Closing Comment

by:dbbishop
ID: 39701789
Is there an A+ ? Thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

630 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