Table column showing earliest instance indicator

Sam_NY

New Member
Joined
Jul 9, 2018
Messages
8
New to forum! Hello and thanks!

I'm trying put a column in a table of donations that indicates whether or not its the earliest donation ("FirstGift") from that individual donor. Or, better yet, have a column return whatever place each gift is ("GiftNumber") with 1 being the first/earliest gift, 2 the second, etc. Donor IDs may duplicate. Here's the sample table I'm working with (2 right-most cols are my desired output):

Date donorID Gift Amt FirstGift GiftNumber
6/29/2018 111 100 1 1
7/2/2018 222 200 0 2
7/1/2018 111 100 0 2
7/2/2018 111 500 0 3
6/29/2017 222 50 1 1

I'd like to do this with formulas, not VBA. I've gotten as far as getting the date of the earliest gift inserted in each cell using this as a ctrl + shift + enter formula: =MIN(IF([donorID]=[@donorID],[Date]))

And I suspect that doing something like this within an INDEX/MATCH formula would do it, but I'm new to CSE formulas in general and INDEX/MATCH specifically and can't seem to wrap my head around how to do it for FirstGift (much less GiftNumber). Appreciate any help on either method.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
This works if you sort by date:


Excel 2010
ABCDE
1DatedonorIDGiftFirstGiftGiftNumber
26/29/20172225011
36/29/201811110011
47/1/201811110002
57/2/201822220002
67/2/201811150003
Sheet5
Cell Formulas
RangeFormula
E2=COUNTIF($B$2:B2,B2)
 
Last edited:
Upvote 0
Thanks, sheetspread. Is there a way method that doesn't require sorting first? I guess I could even do an IF() function with a sorted list - though yours is better - but would prefer something where the rankings stay the same regardless of sorting/filtering.
 
Upvote 0
This?


Excel 2010
ABCDE
1DatedonorIDGiftFirstGiftGiftNumber
26/29/201811110011
37/2/201822220002
47/1/201811110002
57/2/201811150003
66/29/20172225011
Sheet5
Cell Formulas
RangeFormula
E2=COUNTIFS($B$2:$B$6,B2,$A$2:$A$6,"<="&A2)
 
Upvote 0
Yup, that works exactly how I want! Thanks very much. If it's simple to explain I'd love to know how this works: "<="&A2

I would think that would yield a string, but it's obviously just serving as a condition. And I'm guessing <=A2 wouldn't work. Why on earth would the operator go in quotes?
 
Upvote 0
I'm not sure why the countif syntax is so strict: constants must be entered as "<=5" and "<="&a2 for a cell reference.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top