How best to code or set-up macro to calculate total requests count by company (1 Viewer)

psimpson

Registered User.
Local time
Today, 07:56
Joined
Aug 1, 2007
Messages
40
Hello!

I am wanting to set-up a macro or code an "if statement" in MS Excel 365 that will allow me to find whether a company has previously made a request, if so to identify today's current aggregate total and add the new entry's total to it to arrive at a new aggregate total.

Can someone offer a suggestion on how best to accomplish this task?

I am not currently using VBA or the developer's tool in MS Excel.

Any help is greatly appreciated.
 

Isaac

Lifelong Learner
Local time
Today, 07:56
Joined
Mar 14, 2017
Messages
8,777
Gasman has a good suggestion.
But I would add to this that technical questions need to be technically framed for best results.

Too often people provide superfluous information that only clouds. With the exception of asking for suggestions on UI or suggestions on table setup, I never gain anything from people's description about their businesses, i.e. "we are a company with offices in sacramento and hong kong that rents yellow cars for $5/hour to graduate students" - and in fact, I usually lose some clarity in the process of all that info.
(Not that I am saying you did that - ha ha - just an example of the extreme). :)

Frame your question like this:

"If I have ___type of data in column A, ____type of data in column B, how do I return the answer to ________this logical question in column C"

Uploading a sample spreadsheet is a bonus, but also being totally able to 100% frame the question in writing narrowly in technical terms - as best as you can - is a skill that will end up virtually defining your life as a [good] developer and is never too soon to start.

Cheers
 

psimpson

Registered User.
Local time
Today, 07:56
Joined
Aug 1, 2007
Messages
40
Well, here is my pseudocode:

enter coabbr, coseq#
if coabbr previously entered then
find coabbr with max aggregate_coseq# value
add new coseq# cell value to it
return aggregate_coseq#
else
aggregate_coseq# = new coabbr and set initial coseq# value in aggregate_coseq# field
endif

"If I have alpha-numeric type of data in column A, numerical type of data in column B, how do I return the answer to determine whether coabbr has been listed before today and how many times. Find the entry with the max coseq# for the coabbr. Add this max value to today's counter and return the aggregate total which is this logical question in column C"

I hope that this helps.
 

Isaac

Lifelong Learner
Local time
Today, 07:56
Joined
Mar 14, 2017
Messages
8,777
Do you also need a column with the Date - in order to source the logic "before today" etc ?
 

Users who are viewing this thread

Top Bottom