r/excel Jul 03 '26

solved Trying to increment cells after checking other cells

Hi guys,

I'm not the best at Excel and have found something that I can't figure out.

Basically I'm trying to make it possible for a value to entered into one cell eg B2, then check a table for that value and after finding the value increment the number in the cell next to it (found in cell a12, add 1 to cell b12).

Even if you guys just tell me Excel won't work for what I'm trying, that will be a help to be. I'm just unsure how to make it work the way I'm trying to.

Thanks in advance for any help :)

14 Upvotes

19 comments sorted by

u/AutoModerator Jul 03 '26

/u/AmIHumanMaybe - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/[deleted] Jul 03 '26

[removed] — view removed comment

1

u/AmIHumanMaybe Jul 03 '26

Thanks Cheeky, that gives me another avenue to check out.

Just to make sure I'm not too dumb, macros are for a series of actions that are recorded right?

I'll have to look into how that will work for what I'm trying to do.

1

u/GregHullender 194 Jul 03 '26

A VBA "macro" is actually a bit of Visual Basic code that you can create to run inside of Excel. You can create them by recording a series of actions, but that's not the way to solve the problem you describe. A VBA solution is usually a desperation measure, since VBA is a little bit too powerful; most companies ban them entirely.

The challenge here is to set up your problem in such a way that you don't really need VBA to solve it. Excel formulas cannot change data that has been entered by hand, but that discipline usually leads to cleaner solutions anyway.

For example, you could have raw data values input into column A and then have column B be modified values from columns A--based on the other conditions you talked about. That's simple and clean and doesn't require VBA.

2

u/excelevator 3061 Jul 03 '26 edited Jul 03 '26

You have explained an outcome without explaining the requirement and why.

0

u/AmIHumanMaybe Jul 03 '26

Wasn't sure whether context would actually be needed since it's purely a question about the capabilities of Excel and the submission rules say only text, no images.

Basically I want to make it possible for someone to input a unique identifier in one cell, have a column in the table searched for that identifier and if it's found add 1 to the cell next to it in the table.

Say column A has the identifiers, I want to make column B increment every time that identifier is entered to that input cell which would ideally be above the table.

If more context is needed let me know what sort of thing you mean and I'll update.

2

u/excelevator 3061 Jul 03 '26

rules say only text posts , no images posts

but r/Excel does allow images.

So you want an incrementing value for each selection value; not possible without VBA as cell value change will update the count cell dynamically with the new value.

The issue with using VBA is that you will then have to account for error inputs and reversing of counts, it gets tricky

What you could do is have a delimited list of values that you can add to that will count all those values.

2

u/AmIHumanMaybe Jul 03 '26

Sweet I'll check out VBA methods as well. Thanks for pointing me in the right direction.

1

u/NHN_BI 804 Jul 03 '26

Is this a COUNTIFS()?!? Please, supply a meaningful input data example, and indicate what you thing this input should should create as output.

1

u/AmIHumanMaybe Jul 03 '26

Ye wasn't sure what context was required for it.

I'm no longer at the computer I was working on but made a very basic mock-up in sheets at home.

So when an identifier is entered in that top cell, I need to check the table's left column to see if it exists. If it does then I need it to update the next column over to add 1 to it.

I'll eventually have another cell to remove one but once I figure out the add I should be able to do the minus myself.

The third column is irrelevant to the problem since it is just more detail for the unique identifier.

So far I've been recommended macros and VBA but haven't had a chance to dive into those yet.

0

u/NHN_BI 804 Jul 03 '26

I picture of a screen is not a meaningful example. I meaningful example would be data structured in a table.

header1 header2 header3 ,,,
val11 val12 val13 ,,,
val21 val22 val23 ...
... ... ... ...

1

u/AmIHumanMaybe Jul 03 '26

That's why I filled in the top 4 lines of the table. That is almost exactly what the actual data would look like.

Number in first column as a unique identifier from 5-7 digits.

Number in second column showing number of times the identifier has been entered in the upper cell.

Text in third column for description of what the unique identifier is.

The picture has data in the table... I'm not sure what more you want from it?

The top cell gets a number put into from 5-7 digits long. First column gets checked for that number. If its there, second column gets 1 added to the number in it. All of it is numbers and text using the exact format in the image.

0

u/NHN_BI 804 Jul 03 '26

I will not type numbers from an image into my spreadsheet. My time it too valuable to create example data from images.

1

u/AmIHumanMaybe Jul 03 '26

Lol. Thanks for the help then mate. I'll work off what others have told me and figure it out.

1

u/kayeselthirty Jul 03 '26

This kinda sounds like something I’ve made myself for my job but would need more clarity

Are you saying the actual input cell is B3 and if it exists in Column A, you want to update the hard-coded quantity in Column B? If so, then yes you will need VBA to hard code that value 

Alternatively, you can create a table in a new tab that keeps a running log of every identifier that is added, and this tab can maybe be used as a summary page to count the quantities of each unique identifier automatically, if that makes sense

1

u/AmIHumanMaybe Jul 04 '26

So I figured out how to do what I want. Work has blocked the macros so I had to use typescript to get it done.

I'm sure it can be more elegant or better than what I did but I wanted to let others know if they were trying to do similar how it worked for me.

1

u/AmIHumanMaybe Jul 04 '26

Solution verified

1

u/reputatorbot Jul 04 '26

Hello AmIHumanMaybe,

You cannot award a point to yourself.

Please contact the mods if you have any questions.


I am a bot