Nested If Formula Difficulty

drsglsals

New Member
Joined
Jul 25, 2015
Messages
8
Hello, I am trying to make a cell display a certain date using nested IF arguments or Vlookup if that is more appropriate?.

For example, When a date is manually entered into A1, B1 should then display another date that precedes the date in A1 by either 30, 60, 90, or 120 days prior to the date in A1. Cell C1 is the criteria for how many days B1 should precede A1. Cell C1 is always text.

Continuing the example, dog=30, cat=60, mouse=90, rat=120

If 15-Apr-16 is entered in A1, and C1 is "cat", then B1 should display 14-Jun-16.

Thank you
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Welcome to the forum.

Try

=A1-LOOKUP(C1,{"Cat","Dog","Mouse","Rat"},{60,30,90,120})

Realised you said precedes, but the example shows a date later! If you want to add 60 days change the minus to a plus.
 
Last edited:
Upvote 0
That worked perfectly! Thank you. And my mistake on using a date further in time after asking about preceding.
 
Upvote 0
Gaz_Chops, I have hit another sticking point if you are willing to assist further. Using my original example, I need to add two more potential answers in C1 "frog" and "toad". If frog or toad are selected, I need B1 to not compute anything and remain blank or display "N/A".

Thank you
 
Upvote 0
Try

=IF(OR(C1={"Frog","Toad"}),"",A1-LOOKUP(C1,{"Cat","Dog","Mouse","Rat"},{60,30,90,120}))
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top