# Nested If Statements

#### Polishkitty

##### New Member
Hi,

I have an Excel worksheet that has one column (e.g. B2) that contains the date. I also have 12 columns to the right that show January (Q4), Februrary(P4), etc. Under those dates there are numbers fo reach month (Q5 has January value, P5 has February value).

What I am trying to do is this: Based on the month in B2 or current month, I want to be able to compare the current month value (P5) to last month's value (Q5) and show an arrow in another cell that displays to the the right if values are the same , down if current month is lower than previous month and up arrow if current month is higher that previous month.

Now I was able to get the formula to work for February so that it compares february (current month) to January (previous month) and returns an arrow. What I need is a way to have this formula compare the next month and previous month when cell B2 is the new month, e.g. March. So if I type 3/1/14 in B2, the formula would know to compare S5 (March value) to R5 (February value) and provide the correct arrow. Here is the formula for one month: =IF(\$B\$2=\$Q\$4,IF(Q7=P7,RIGHTARROW,IF(Q7<P7,DOWNARROW,UPARROW))).

Thanks.
Polishkitty

### Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

#### goesr

##### Well-known Member
Hi Polishkitty - I think your formula was cut off when you pasted it in. You might try reposting with the complete formula and an example of your data. That may make it easier to understand what you need. Hope this helps.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,009
Messages
5,834,876
Members
430,325
Latest member
Thony

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back