• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Multiple If conditions to return value based on the slabs|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Multiple If conditions to return value based on the slabs|General Excel Questions & Answers|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Multiple If conditions to return va…
sp_PrintTopic sp_TopicIcon
Multiple If conditions to return value based on the slabs
Avatar
Ali Uddin

New Member
Members
Level 0
Forum Posts: 1
Member Since:
October 27, 2019
sp_UserOfflineSmall Offline
1
October 27, 2019 - 9:05 pm
sp_Permalink sp_Print

I need your help to automate a long manual activity which takes allot of time. Every week I have received stock transfer requests of 500 line items from LHR and ISB to replenish the stock from KHI which is our central Warehouse to feed both locations. Please see the below table with expected results which i want to be derived from a formula. The purpose is to make inventory transfer of available quantity in KHI to LHR/ISB with equality keeping in view who has more deficit and who has more average monthly sales/consumption. Below are the conditions which I have made and if anyone of you feels that is not logical or need changes you can make changes in the attached excel file while replying to the solution.

Note:                                
Stock can not be transfer in decimals and negative numbers it has to be a whole number so rounding would be required keeping in view the available stock in KHI up to the max of LHR and ISB average monthly sales.
Below are the logics                              
1-Since KHI is our mother location so it has to make sure KHI should not be < its monthly sales no matter LHR and ISB has zero stock          
2-If LHR or ISB has current stock = their monthly average sales then no transfer is required no matter quantities are available in KHI          
3-Transfer will only be executed if LHR / ISB has < its average monthly sales means if their current deficit < 100              
4- if KHI has enough stock to fulfill both LHR/ISB requirement then relenish both upto their max deficit              
5- if KHI has only one extra qty and deficit of anyone location is >= 80% then proceed transfer to that location              
6- if KHI has only one extra qty and deficit of both location is >= 80% then check whose average sales is higher then otherone then proceed for that location        
7- if both locations deficit is equal and KHI available is not enough to satisfy both then the qty will be equally devided equally to both keeping in view of if quantity is ODD then it will be -1 then divided by 2  
8- If one has defcit >= 80% and other has <=20% and available stock can completely fullfil the one has higher deficit then all feed to that one and if still have leftover stock in khi then send to other location  
9- If one has defcit >= 80% and other has <=20% and khi has not enough to fullfill the one has higher deficit completely then available stock will be splitted in 80-20% respectively      
10- If one has defcit >= 60% and other has <=35% and available stock can completely fullfil the one has higher deficit then all feed to that one and if still have leftover stock in khi then send to other location  
11- If one has defcit >= 60% and other has <=35% and khi has not enough to fullfill the one has higher deficit completely then available stock will be splitted in 60-35% respectively      
12- If one has defcit >= 45% and other has <=35% and khi has not enough to fullfill the one has higher deficit completely then available stock will be splitted in 45-35% respectively      
13- If one has defcit >= 45% and other has <=35% and available stock can completely fullfil the one has higher deficit then all feed to that one and if still have leftover stock in khi then send to other location  
14- If one has defcit >= 35% and other has <=20% then available stock will be splitted equally keeping in view if quantity is ODD then it will be -1 then divided by 2      
15- If one has defcit <= 35% and other has <=20% then available stock will be splitted equally keeping in view of ODD then it will be -1 then divided by 2        

 

  Average Monthly Sales Current Stock Current Deficit   This is the expected outcome
Items KHI LHR ISB KHI LHR ISB LHR Qty LHR% ISB Qty ISB How much Extra in KHI LHR ISB
Item-01 81 9 21 200 20 15 11 122% -6 -29% 119 Enough Stock 6
Item-02 67 32 28 108 25 25 -7 -22% -3 -11% 41 7 3
Item-03 57 30 11 36 33 10 3 10% -1 -9% -21 KHI Low KHI Low
Item-04 0 26 14 36 0 7 -26 -100% -7 -50% 36 26 7
Item-05 66 33 17 200 10 30 -23 -70% 13 76% 134 23 Enough Stock
Item-06 77 26 20 118 30 36 4 15% 16 80% 41 Enough Stock Enough Stock
Item-07 81 15 22 90 7 15 -8 -53% -7 -32% 9 5 4
Item-08 59 10 32 67 7 18 -3 -30% -14 -44% 8 1 7
Item-09 42 26 27 43 17 8 -9 -35% -19 -70% 1 0 1
Item-10 53 40 29 66 31 22 -9 -23% -7 -24% 13 7 6

Thanks in advance

Avatar
Frans Visser
Duivendrecht (near Amsterdam) - The Netherlands

VIP
Members
Level 2
Forum Posts: 346
Member Since:
April 21, 2015
sp_UserOfflineSmall Offline
2
October 29, 2019 - 6:18 am
sp_Permalink sp_Print

One can ask himself if this is something to be solved here?

Did you try it yourself Ali and what did you encounter on problems or difficulties where we can help you with?

Frans

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 873
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
3
October 29, 2019 - 6:21 am
sp_Permalink sp_Print sp_EditHistory

Hello Ali,

Welcome to this forum. I will gladly help with any questions you might have in order to learn how to accomplish what you want Excel to do for you.

Do check out these two blog articles, they might help you move forward.
https://www.myonlinetraininghu.....s-function
https://www.myonlinetraininghu.....nested-ifs

I can also recommend the courses available here at MOTH, the information you get in both the training files and the explanations on how to use it all is very good. Check out this course for example. https://www.myonlinetraininghu.....las-course

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Ashleigh Farquharson
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Gilbert Lemek
Ashleigh Farquharson
Jayz Luu
Fred Smith
Charles DeGraffenreaid
Cathi Giard
Sarah Young
Henry Delgado
Alita Nieuwoudt
KL KOH
Forum Stats:
Groups: 3
Forums: 24
Topics: 6360
Posts: 27812

 

Member Stats:
Guest Posters: 49
Members: 32340
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.