+ Reply to Thread
Results 1 to 7 of 7

modify actual formula with if based of 4 digit criteria of another column

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    modify actual formula with if based of 4 digit criteria of another column

    I have a workbook that extract quantities in column Q depending on data of columns F and G and AI .

    That is if column AI shows "U","m2","2U"} then extract qty from column O otherwise if it shows L in column AI then multiply value in column F and G .

    IF kg IN COLUMN AI then do nothing.



    =IF(AI26="L",IFERROR(1/(1/(F26*G26)),""),IF(OR(AI26={"U","m2","2U"}),O26,""))

    But I need to add a special criteria in the formula which is based on column B that is the first four digit only starts with 2106 or 3923 or 3924, then extract quantity in column O (note that in column Ai THE UNIT OF MEASURE IS kg but only applies for 2106 3923, 3924 .

    Needs assistance to revised the above formula.

    sample expected results shown at rows at 24 to 26 .
    Attached Files Attached Files
    Last edited by JEAN1972; 07-27-2019 at 11:44 AM. Reason: typo

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,270

    Re: modify actual formula with if based of 4 digit criteria of another column

    One way, simplay adding to your formula:

    =IFERROR(LOOKUP(1000,SEARCH({"2106","3923","3924"},B2),O2*{1,1,1}),IF(AI2="L",IFERROR(1/(1/(F2*G2)),""),IF(OR(AI2={"U","m2","2U"}),O2,"")))

    copied down.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: modify actual formula with if based of 4 digit criteria of another column

    Hi Glenn

    Working as requested thank you but just a little explanation meaning for O2*{1,1,1}

    Richard working but those for litres (L) , not giving expected results giving results of column instead of multiplication of column F and G

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: modify actual formula with if based of 4 digit criteria of another column

    Maybe

    Formula: copy to clipboard
    =IFERROR(IF(MATCH(LEFT(B2,4),{"2106","3924","3923"},FALSE)>0,O2),IF(F2="","",O2))
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,270

    Re: modify actual formula with if based of 4 digit criteria of another column

    Richard... that's neat... even if it doesn't give the required result. This modification does:

    =IFERROR(IF(MATCH(LEFT(B2,4),{"2106","3924","3923"},FALSE)>0,O2),IF(F2="","",F2*G2))

    but both yours and my modification of yours fail at row 27... and I don't understand why
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,270

    Re: modify actual formula with if based of 4 digit criteria of another column

    Jean, it's simply a way of putting O2 into an array 3 times, to permit comparison with the 3 search terms.

  7. #7
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: modify actual formula with if based of 4 digit criteria of another column

    ok thank you for explanation

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Alpha numeric with max 3 digit numbers based on criteria
    By Barieq in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-23-2018, 06:53 AM
  2. Modify a MsgBox with an actual Sheet destination
    By 0o0o0 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-19-2018, 09:01 PM
  3. Modify Copied Rows Based on Criteria
    By BungaBunga in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-22-2016, 04:52 PM
  4. Modify Copied Rows Based on Criteria
    By BungaBunga in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2016, 11:46 AM
  5. Replies: 0
    Last Post: 05-02-2016, 07:59 AM
  6. [SOLVED] Automatically Change 3/4 Digit Numbers to Actual Time
    By ZooTV92 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-22-2016, 02:45 PM
  7. [SOLVED] HELP!!- modify code so only data based on criteria is copied over
    By indik in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-15-2015, 08:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1