if

Forum home » Delegate support and help forum » Microsoft Excel Training and help » IF

IF

resolvedResolved · 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.


 

Excel tip:

The Easiest and Quickest Way to use Autosum in Excel 2010

Autosum 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.

1) Go to the bottom of the column of data.

2) Shortcut click in the column then Ctrl + down arrow

3) Use Alt + = for Autosum and press the enter key to complete.

View all Excel hints and tips


Server loaded in 0.06 secs.