98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » IF
IF
Resolved · Urgent Priority · Version 365
Lauren has attended:
Excel Advanced course
IF
Hi
We want to use an IF formula in a Vlookup.
the cells are in short date format... we want to do:
IF date is in the previous month, insert cell ***.
how would we go about doing this?
Many thanks,
Lauren
RE: IF
Hi Lauren
Thanks for your question. I wasn't quite sure exactly what you were looking for, so I have a couple of options.
The section I think you're really looking for is an IF function that evaluates if the date is in the previous month, which we can achieve using the MONTH and TODAY function:
=IF(MONTH(date_cell)=MONTH(TODAY())-1,cell***,another_cell)
You could then combine this with your VLOOKUP.
If you would like to use a lookup value to return a date, then assess if the date is in the previous month and insert cell***, then nest the VLOOKUP inside the IF:
=IF(MONTH(VLOOKUP(lookup value,table array,column no.,0))=MONTH(TODAY())-1,cell***,another cell)
If you would like to test if a cell is in the previous month, then insert cell*** as the lookup value, nest the IF inside the VLOOKUP:
=VLOOKUP(IF(MONTH(date_cell)=MONTH(TODAY())-1, cell***,another_cell),table arrray,column no.,0)
Please let me know if you have any further questions about this.
Kind Regards,
Sarah Reid
Excel Trainer
Wed 19 Apr 2017: Automatically marked as resolved.
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:The Easiest and Quickest Way to use Autosum in Excel 2010Autosum is used frequently in Excel. As with almost every feature of Excel, there are more ways than one to use each feature. Below is the simplest way to use the Autosum feature. |