calling all Excel guru

IHAVEAQUESTION

Golden Member
Nov 30, 2005
1,059
1
81
Well, an Excel problem arises from my work and I believe there is a solution but I just don't know how.

Let's say 68001, 68002, 68003 are the sub-accounts of 68000, I want to be able to group them by the parent account (68000), I want my formula to do the following:

if(left(AccountNumber,5)=(68001, 68002, 68003),68000,0)

Well, that didn't work. I tried to put quote around each account number that still doesn't work. Any help?
 

el-Capitan

Senior member
Apr 24, 2012
572
2
81
I am no expert and i am not 100 % clear on what you trying to achieve.

if(left(AccountNumber,5)=(68001, 68002, 68003),68000,0)

Those seem to be alternatives, but that will not work. Not very pretty, but you can nest the IF formula to test for alternative scenarios.

=IF(B1=68001,68000,IF(B1=68002,68000,IF(B1=68003,68000,B1)))

You are using LEFT incorrectly. it returns text only. I do not know the equivalent for numbers
 

IHAVEAQUESTION

Golden Member
Nov 30, 2005
1,059
1
81
Text is just fine. Because the column I am extracted the account number from looks like:

"68001 Global development"

So I really just want the first 5 characters from the left, unless there is a better way to extract it.

That's a lot of nested "IF"...some parent accounts have tens of sub-accounts and these sub-account numbers are all over the place, meaning they are not sequential or in any order. So using your method will be lengthy and confusing. Thanks for the suggestion though.
 
Last edited:

el-Capitan

Senior member
Apr 24, 2012
572
2
81
LEFT is now understood. But i cannot get it to work with the nested approach.

You are correct, if you have dozens of different account numbers, then my solution is very impractical.

Sorry, cannot help :/
 

IHAVEAQUESTION

Golden Member
Nov 30, 2005
1,059
1
81
Can't believe there is not a similar formula as SQL's:

AccountNumber in (xxxxx,xxxxx,xxxxx)

Any other help?
 

Binky

Diamond Member
Oct 9, 1999
4,046
4
81
Consider using a vlookup or index/match function. You could build a table of all master and sub accounts, and have your function pull the master account from there.
 

sweenish

Diamond Member
May 21, 2013
3,656
60
91
It almost sounds like before we get into any formulas or even VBA, the spreadsheet itself might need some organizing, or like Binky said, a new table that you can reference.
 

Puffnstuff

Lifer
Mar 9, 2005
16,145
4,844
136
Well you can nest up to 64 items in an IF function so it should work. Just remember to tell it what to do if true and if false in the dialog box. Once you get the parent cell established you can build a table or you can drag and drop the formula across the affected cells. You need to start with IF(D5=>68000,,), using D5 as the example cell containing the information. You can google office help and find the tutorial on the IF function pertaining to numbers like this.
 
Last edited:

Blazer7

Golden Member
Jun 26, 2007
1,136
12
81
=IF(AND(VALUE(LEFT(cellnumber;5))>=68000;VALUE(LEFT(cellnumber;5))<=68999);"68000";"0")

HTH

PS
Because of my local settings I have to use ; instead of ,
Just adjust to your needs
 
Last edited:

Dulanic

Diamond Member
Oct 27, 2000
9,951
570
136
That or use a VLOOKUP and VALUE and place the values your grouping in another area...If you put the values in a named range you could do it like so...

=IF(VLOOKUP(VALUE(LEFT(AccountNumber,5)),LookupRange,1,FALSE),VLOOKUP(VALUE(LEFT(AccountNumber,5)),LookupRange,2,FALSE),0)
 
Last edited:
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |