Help! Im hopelessly lost in huge nested IF formula and i can't get it to work properly..

coban

New Member
Joined
Oct 25, 2010
Messages
25
Ref. screenshot: Imgur: The most awesome images on the Internet

Here is the formula in question:

=IF(B13="";"";IF(C13="Online";IF(B13="Denmark";(DATE(D13;1;-2)-WEEKDAY(DATE(D13;1;3))+((F13-$G$2)*7))+1;(DATE(D13;1;-2)-WEEKDAY(DATE(D13;1;3))+((F13-$G$2)*7))+1);IF(B13="Denmark";(DATE(D13;1;-2)-WEEKDAY(DATE(D13;1;3))+((F13-$G$3)*7))+1;(DATE(D13;1;-2)-WEEKDAY(DATE(D13;1;3))+((F13-$G$4)*7))+1)))

Let me try to how it works, and how it should work:
- I want our marketing department to insert the blue fields "marketing", and then i want the rows in column "K" ("forecast from" - "forecast to", ref. formula above) to calculate a certain date: Tuesday of the "Weeknumber" column. Ref# screenshot/imgur, eg: If "Online" and "Weeknumber" = 6, then it should display: 2/2-16, Tuesday week 5. The rest of the dates are just minor changes from this date.

- Currently it works like this: Based on "sell-from" - "sell- to" dates, the "weeknumber" column ("F") get the proper week then adds "lead time" based on static values eg. "denmark", "online".

- I want it to find Tuesday of the "weeknumber" cell, but based on the matrix -- not the rubbish static values. If it is an online activity it should always grab the "Online" leadtime. But if it is "Physical", then it should grab the leadtime based on the country/"denmark, norway, finland, sweden".​

It worked until some C-level executives started digging their nose in my spreadsheet, and now i have to clean up the mess i made since they want to distribute it around.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
You could use a formula like this to find your leadtimes:

=IF(B13="","",INDEX($E$2:$G$6,MATCH("*"&B13&"*",E2:E5,0),3))
 
Upvote 0

Forum statistics

Threads
1,216,474
Messages
6,130,841
Members
449,598
Latest member
sunny_ksy

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